Permalink
Browse files

spec for hidden input when adding a multiple select

  • Loading branch information...
1 parent 00d4311 commit 2bf60140eb7c5a513c6de4aecb7906a7274cd1bf @kchien kchien committed Feb 16, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 spec/inputs/select_input_spec.rb
@@ -370,6 +370,15 @@
output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form li select option[@selected]', :count => 1)
end
+
+ it 'should have a hidden input for multiple selects' do
+ @form = semantic_form_for(@fred) do |builder|
+ concat(builder.input(:posts, :as => :select, :multiple => true, :include_blank => true))
+ end
+
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
+ output_buffer.should have_tag("form li input[@type='hidden']")
+ end
end
describe 'for a has_and_belongs_to_many association' do

0 comments on commit 2bf6014

Please sign in to comment.