Permalink
Browse files

Add tests for mongoid 4 beta 1

  • Loading branch information...
1 parent c347875 commit 03a4518635edde14cd3198dfc8e82c2ac23d52b8 @arthurnn arthurnn committed Feb 2, 2014
View
@@ -21,6 +21,7 @@ gemfile:
- gemfiles/mongoid_24.gemfile
- gemfiles/mongoid_30.gemfile
- gemfiles/mongoid_31.gemfile
+ - gemfiles/mongoid_40.gemfile
- gemfiles/sinatra_13.gemfile
- gemfiles/sinatra_14.gemfile
@@ -0,0 +1,14 @@
+source 'https://rubygems.org'
+
+gem 'railties', '~> 4.0'
+gem "mongoid", "~> 4.0.0.beta1"
+gem 'rspec-rails', '>= 2.0'
+
+platforms :rbx do
+ gem 'rubysl', '~> 2.0'
+ gem 'racc'
+ gem 'rubysl-test-unit'
+ gem 'rubinius-developer_tools'
+end
+
+gemspec :path => '../'
@@ -8,7 +8,7 @@
end
Mongoid.configure do |config|
- if Mongoid::VERSION =~ /^3/
+ if Mongoid::VERSION > '3.0.0'
config.sessions = {:default => {:hosts => ['localhost:27017'], :database => 'kaminari_test'}}
else
config.master = Mongo::Connection.new.db('kaminari_test')
@@ -1,5 +1,9 @@
class User
include ::Mongoid::Document
+ if Mongoid::VERSION > '4.0.0'
+ include Mongoid::Attributes::Dynamic
+ end
+
field :name, :type => String
field :age, :type => Integer
end
@@ -98,7 +98,7 @@
end
shared_examples 'complete valid pagination' do
- if Mongoid::VERSION =~ /^3/
+ if Mongoid::VERSION > '3.0.0'
its(:selector) { should == {'salary' => 1} }
else
its(:selector) { should == {:salary => 1} }

0 comments on commit 03a4518

Please sign in to comment.