Tests for formmethod attribute support

This commit is contained in:
Emilia 2014-08-12 09:45:11 +02:00
parent 304e2fbfe1
commit 91a83f791b
2 changed files with 10 additions and 0 deletions

View File

@ -355,6 +355,15 @@ Capybara::SpecHelper.spec '#click_button' do
end
end
context "with formmethod attribute on button" do
it "should submit to the formethod attribute" do
@session.click_button('Formmethod button')
expect(@session.current_path).to eq '/form/get'
@results = extract_results(@session)
expect(@results['which_form']).to eq 'formaction form'
end
end
it "should serialize and send valueless buttons that were clicked" do
@session.click_button('No Value!')
@results = extract_results(@session)

View File

@ -434,6 +434,7 @@ New line after and before textarea tag
<input type="text" name="form[which_form]" value="formaction form"/>
</p>
<input type="submit" name="form[button]" formaction="/form" value="Formaction button"/>
<input type="submit" name="form[button]" formaction="/form/get" formmethod="get" value="Formmethod button"/>
</form>
<form action="relative" method="post">