mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Add tests for mongoid 4 beta 1
This commit is contained in:
parent
c347875085
commit
03a4518635
5 changed files with 21 additions and 2 deletions
|
@ -21,6 +21,7 @@ gemfile:
|
||||||
- gemfiles/mongoid_24.gemfile
|
- gemfiles/mongoid_24.gemfile
|
||||||
- gemfiles/mongoid_30.gemfile
|
- gemfiles/mongoid_30.gemfile
|
||||||
- gemfiles/mongoid_31.gemfile
|
- gemfiles/mongoid_31.gemfile
|
||||||
|
- gemfiles/mongoid_40.gemfile
|
||||||
- gemfiles/sinatra_13.gemfile
|
- gemfiles/sinatra_13.gemfile
|
||||||
- gemfiles/sinatra_14.gemfile
|
- gemfiles/sinatra_14.gemfile
|
||||||
|
|
||||||
|
|
14
gemfiles/mongoid_40.gemfile
Normal file
14
gemfiles/mongoid_40.gemfile
Normal file
|
@ -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 @@ if RUBY_VERSION >= '1.9.2'
|
||||||
end
|
end
|
||||||
|
|
||||||
Mongoid.configure do |config|
|
Mongoid.configure do |config|
|
||||||
if Mongoid::VERSION =~ /^3/
|
if Mongoid::VERSION > '3.0.0'
|
||||||
config.sessions = {:default => {:hosts => ['localhost:27017'], :database => 'kaminari_test'}}
|
config.sessions = {:default => {:hosts => ['localhost:27017'], :database => 'kaminari_test'}}
|
||||||
else
|
else
|
||||||
config.master = Mongo::Connection.new.db('kaminari_test')
|
config.master = Mongo::Connection.new.db('kaminari_test')
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
class User
|
class User
|
||||||
include ::Mongoid::Document
|
include ::Mongoid::Document
|
||||||
|
if Mongoid::VERSION > '4.0.0'
|
||||||
|
include Mongoid::Attributes::Dynamic
|
||||||
|
end
|
||||||
|
|
||||||
field :name, :type => String
|
field :name, :type => String
|
||||||
field :age, :type => Integer
|
field :age, :type => Integer
|
||||||
end
|
end
|
||||||
|
|
|
@ -98,7 +98,7 @@ if defined? Mongoid
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'complete valid pagination' do
|
shared_examples 'complete valid pagination' do
|
||||||
if Mongoid::VERSION =~ /^3/
|
if Mongoid::VERSION > '3.0.0'
|
||||||
its(:selector) { should == {'salary' => 1} }
|
its(:selector) { should == {'salary' => 1} }
|
||||||
else
|
else
|
||||||
its(:selector) { should == {:salary => 1} }
|
its(:selector) { should == {:salary => 1} }
|
||||||
|
|
Loading…
Reference in a new issue