Permalink
Browse files

Merge pull request #1 from semaperepelitsa/master

Customized field
  • Loading branch information...
2 parents 95235e6 + 2e31a85 commit 58f4de06095e697ab76e55d882335ffeab7a514c @pyromaniac committed Feb 3, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/mongoid/orderable_spec.rb
View
16 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 58f4de0

Please sign in to comment.