Fix form fields being double-escaped with :rack

Signed-off-by: Simon Rozet <simon@rozet.name>
This commit is contained in:
Damian Janowski 2009-06-23 21:43:32 -03:00 committed by Simon Rozet
parent cf8d891302
commit cbc447223c
2 changed files with 10 additions and 12 deletions

View File

@ -87,10 +87,8 @@ module Webrat
parse_rails_request_params("#{name}=#{escaped_value}")
when :merb
::Merb::Parse.query("#{name}=#{escaped_value}")
when :mechanize
{ name => value }
else
{ name => escaped_value }
{ name => value }
end
end

View File

@ -8,15 +8,15 @@ class WebratRackTest < Test::Unit::TestCase
assert_have_tag("form[@method='post'][@action='/go']")
end
# def test_submits_form
# visit "/go"
# fill_in "Name", :with => "World"
# fill_in "Email", :with => "world@example.org"
# click_button "Submit"
#
# assert_contain "Hello, World"
# assert_contain "Your email is: world@example.org"
# end
def test_submits_form
visit "/go"
fill_in "Name", :with => "World"
fill_in "Email", :with => "world@example.org"
click_button "Submit"
assert_contain "Hello, World"
assert_contain "Your email is: world@example.org"
end
def test_check_value_of_field
visit "/"