Fix some bugs uncovered when running the weplay scenarios

This commit is contained in:
Bryan Helmkamp 2008-04-07 20:35:06 -04:00
parent d492c4fb90
commit 118cf0340a
4 changed files with 10 additions and 4 deletions

View File

@ -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.
#

View File

@ -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

View File

@ -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

View File

@ -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