Permalink
Browse files

Spec for set collections and symbols in collections

  • Loading branch information...
dwbutler committed Sep 4, 2012
1 parent 63bfbd0 commit a93299a8d1f361b7f5f7550fd67761f2dd13c254
Showing with 17 additions and 0 deletions.
  1. +17 −0 spec/inputs/check_boxes_input_spec.rb
@@ -373,6 +373,23 @@
output_buffer.should have_tag("form li fieldset ol li label input[@value='biography'][@checked='checked']")
end
end
+
+ describe 'when :collection is a set' do
+ before do
+ @output_buffer = ''
+ mock_everything
+ @fred.stub(:roles) { Set.new([:reviewer, :admin]) }
+
+ concat(semantic_form_for(@fred) do |builder|
+ concat(builder.input(:roles, :as => :check_boxes, :collection => [['User', :user], ['Reviewer', :reviewer], ['Administrator', :admin]]))
+ end)
+ end
+
+ it 'should check the correct checkboxes' do
+ output_buffer.should have_tag("form li fieldset ol li label input[@value='admin'][@checked='checked']")
+ output_buffer.should have_tag("form li fieldset ol li label input[@value='reviewer'][@checked='checked']")
+ end
+ end
describe "when namespace is provided" do

0 comments on commit a93299a

Please sign in to comment.