Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bulking up coverage for check_boxes input to ensure no hidden inputs …

…are rendered inside the labels (ref GH-264)
  • Loading branch information...
commit c6ad17f3d2251c01f46752a1a0811aa67fcb9685 1 parent d174db0
Justin French authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 spec/inputs/check_boxes_input_spec.rb
13 spec/inputs/check_boxes_input_spec.rb
View
@@ -46,7 +46,18 @@
it 'should not generate hidden inputs with default value blank' do
output_buffer.concat(@form) if Formtastic::Util.rails3?
- output_buffer.should_not have_tag("form li fieldset ol li label input[@type='hidden'][@value='']", :count => ::Post.all.size)
+ output_buffer.should_not have_tag("form li fieldset ol li label input[@type='hidden'][@value='']")
+ end
+
+ it 'should not render hidden inputs inside the ol' do
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
+ output_buffer.should_not have_tag("form li fieldset ol li input[@type='hidden']")
+ puts output_buffer
+ end
+
+ it 'should render one hidden input for each choice outside the ol' do
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
+ output_buffer.should have_tag("form li fieldset > input[@type='hidden']", :count => 1)
end
describe "each choice" do
Please sign in to comment.
Something went wrong with that request. Please try again.