1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Don't send query params from 'action' in GET forms

This commit is contained in:
Jonas Nicklas 2009-11-18 22:06:06 +01:00
parent 910fa40666
commit 63bc602f2d
3 changed files with 3 additions and 3 deletions

View file

@ -102,7 +102,7 @@ class Capybara::Driver::RackTest
if post? if post?
driver.submit(node['action'].to_s, params(button)) driver.submit(node['action'].to_s, params(button))
else else
driver.visit(node['action'].to_s + '?' + params(button)) driver.visit(node['action'].to_s.split('?').first + '?' + params(button))
end end
end end

View file

@ -156,9 +156,9 @@ shared_examples_for "session" do
it "should serialize and send GET forms" do it "should serialize and send GET forms" do
@session.visit('/form') @session.visit('/form')
@session.click_button('med') @session.click_button('med')
#puts @session.body
@results = extract_results(@session) @results = extract_results(@session)
@results['middle_name'].should == 'Darren' @results['middle_name'].should == 'Darren'
@results['foo'].should be_nil
end end
it "should follow redirects" do it "should follow redirects" do

View file

@ -88,7 +88,7 @@
</p> </p>
</form> </form>
<form action="/form/get" method="get"> <form action="/form/get?foo=bar" method="get">
<p> <p>
<label for="form_middle_name">Middle Name</label> <label for="form_middle_name">Middle Name</label>
<input type="text" name="form[middle_name]" value="Darren" id="form_middle_name"/> <input type="text" name="form[middle_name]" value="Darren" id="form_middle_name"/>