diff --git a/spec/inputs/select_input_spec.rb b/spec/inputs/select_input_spec.rb index 8ab34b9f2..c09bc2775 100644 --- a/spec/inputs/select_input_spec.rb +++ b/spec/inputs/select_input_spec.rb @@ -452,17 +452,15 @@ end describe 'when no association exists' do - before(:each) do + + it 'should still generate a valid name attribute' do concat(semantic_form_for(:project, :url => 'http://test.host') do |builder| concat(builder.input(:author_name, :as => :select, :collection => ::Author.all)) end) - end - - it 'should still generate a valid name attribute' do output_buffer.should have_tag("form li select[@name='project[author_name]']") end - describe 'and :multiple is set to true' do + describe 'and :multiple is set to true through :input_html' do it "should make the select a multi-select" do concat(semantic_form_for(:project, :url => 'http://test.host') do |builder| concat(builder.input(:author_name, :as => :select, :input_html => {:multiple => true} )) @@ -471,6 +469,15 @@ end end + describe 'and :multiple is set to true' do + it "should make the select a multi-select" do + concat(semantic_form_for(:project, :url => 'http://test.host') do |builder| + concat(builder.input(:author_name, :as => :select, :multiple => true, :collection => ["Fred", "Bob"])) + end) + output_buffer.should have_tag("form li select[@multiple]") + end + end + end describe 'when a grouped collection collection is given' do