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
|
||||
|
@ -13,9 +13,11 @@ module Webrat
|
||||
@url = url
|
||||
@method = method
|
||||
@data = data
|
||||
|
||||
|
||||
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
|
||||
|
@ -6,8 +6,8 @@ module Webrat
|
||||
@element = element
|
||||
end
|
||||
|
||||
def matches_text?(text)
|
||||
@element.innerHTML =~ /^\W*#{Regexp.escape(text.to_s)}\b/i
|
||||
def matches_text?(text)
|
||||
@element.innerHTML == text.to_s
|
||||
end
|
||||
|
||||
def choose
|
||||
|
Loading…
Reference in New Issue
Block a user