Fix some bugs uncovered when running the weplay scenarios
This commit is contained in:
parent
d492c4fb90
commit
118cf0340a
|
@ -18,6 +18,10 @@ module ActionController
|
|||
@current_page ||= Webrat::Page.new(self)
|
||||
end
|
||||
|
||||
def current_page=(new_page)
|
||||
@current_page = new_page
|
||||
end
|
||||
|
||||
# Issues a GET request for a page, follows any redirects, and verifies the final page
|
||||
# load was successful.
|
||||
#
|
||||
|
|
|
@ -102,7 +102,7 @@ module Webrat
|
|||
class ButtonField < Field
|
||||
|
||||
def matches_value?(value)
|
||||
@element["value"] =~ /^\W*#{value}\b/i
|
||||
@element["value"] =~ /^\W*#{Regexp.escape(value.to_s)}\b*/i
|
||||
end
|
||||
|
||||
def to_param
|
||||
|
|
|
@ -16,6 +16,8 @@ module Webrat
|
|||
|
||||
reset_dom
|
||||
reloads if @url
|
||||
|
||||
session.current_page = self
|
||||
end
|
||||
|
||||
# Verifies an input field or textarea exists on the current page, and stores a value for
|
||||
|
|
|
@ -7,7 +7,7 @@ module Webrat
|
|||
end
|
||||
|
||||
def matches_text?(text)
|
||||
@element.innerHTML =~ /^\W*#{Regexp.escape(text.to_s)}\b/i
|
||||
@element.innerHTML == text.to_s
|
||||
end
|
||||
|
||||
def choose
|
||||
|
|
Loading…
Reference in New Issue