Add a spec for two checkboxes with the same name (array style)

This commit is contained in:
Bryan Helmkamp 2009-02-08 20:58:43 -05:00
parent 4769a5f90b
commit e97f7fafc5
1 changed files with 18 additions and 0 deletions

View File

@ -151,4 +151,22 @@ describe "uncheck" do
uncheck "remember_me" uncheck "remember_me"
click_button click_button
end end
it "should work with checkboxes with the same name" do
with_html <<-HTML
<html>
<form method="post" action="/login">
<input id="option_1" name="options[]" type="checkbox" value="1" />
<label for="option_1">Option 1</label>
<input id="option_2" name="options[]" type="checkbox" value="2" />
<label for="option_2">Option 2</label>
<input type="submit" />
</form>
</html>
HTML
webrat_session.should_receive(:post).with("/login", {"options" => ["1", "2"]})
check 'Option 1'
check 'Option 2'
click_button
end
end end