Skip to content

Commit

Permalink
bulking up coverage for check_boxes input to ensure no hidden inputs …
Browse files Browse the repository at this point in the history
…are rendered inside the labels (ref GH-264)
  • Loading branch information
justinfrench committed Oct 26, 2010
1 parent d174db0 commit c6ad17f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/inputs/check_boxes_input_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit c6ad17f

Please sign in to comment.