Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

spec for mongoid references fix

  • Loading branch information...
commit 4598a5fa37a2e7707ce45c6a1c97e67cf36489d6 1 parent a4c5361
smix authored committed
Showing with 16 additions and 0 deletions.
  1. +14 −0 spec/inputs/select_input_spec.rb
  2. +2 −0  spec/spec_helper.rb
View
14 spec/inputs/select_input_spec.rb
@@ -31,6 +31,20 @@
end
end
end
+
+ describe "using a related model without reflection's options(Mongoid Document)" do
+ before do
+ @form = semantic_form_for(@new_post) do |builder|
+ concat(builder.input(:mongoid_reviewer, :as => :select))
+ end
+ end
+
+ it 'should draw select options' do
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
+ output_buffer.should have_tag('form li select')
+ output_buffer.should have_tag('form li select#post_reviewer_id')
+ end
+ end
describe 'using a range' do
before do
View
2  spec/spec_helper.rb
@@ -221,6 +221,8 @@ def new_author_path; "/authors/new"; end
mock('reflection', :options => {}, :klass => ::Post, :macro => :has_many)
when :main_post
mock('reflection', :options => {}, :klass => ::Post, :macro => :belongs_to)
+ when :mongoid_reviewer
+ mock('reflection', :options => {}, :klass => ::Author, :macro => :referenced_in, :foreign_key => "reviewer_id")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.