Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a spec for two checkboxes with the same name (array style)
  • Loading branch information
brynary committed Feb 9, 2009
1 parent 4769a5f commit e97f7fa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/public/check_spec.rb
Expand Up @@ -151,4 +151,22 @@
uncheck "remember_me"
click_button
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

0 comments on commit e97f7fa

Please sign in to comment.