Permalink
Browse files

Add basic tests covering custom column... eh? field.

  • Loading branch information...
1 parent 26284b9 commit 2e31a85d074979faba9e2337927b90860e2e92a8 @semaperepelitsa semaperepelitsa committed Nov 29, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/mongoid/orderable_spec.rb
@@ -36,6 +36,12 @@ class EmbeddedOrderable
embedded_in :embeds_orderable
end
+ class CustomizedOrderable
+ include Mongoid::Document
+ include Mongoid::Orderable
+
+ orderable :column => :pos
+ end
describe SimpleOrderable do
before :each do
@@ -251,4 +257,14 @@ def positions
end
+ describe CustomizedOrderable do
+ it 'does not have default position field' do
+ CustomizedOrderable.fields.should_not have_key('position')
+ end
+
+ it 'should have custom pos field' do
+ CustomizedOrderable.fields.should have_key('pos')
+ end
+ end
+
end

0 comments on commit 2e31a85

Please sign in to comment.