1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

[AR, DM, Mongoid, MongoMapper].each {|orm| run orm specs only if orm is loaded }

This commit is contained in:
Akira Matsuda 2012-05-17 21:08:02 +09:00
parent 53bae068e8
commit 854d04af4b
6 changed files with 547 additions and 533 deletions

View file

@ -1,5 +1,6 @@
require 'spec_helper'
if defined? ActiveRecord
describe Kaminari::ActiveRecordRelationMethods do
describe '#total_count' do
before do
@ -26,3 +27,4 @@ describe Kaminari::ActiveRecordRelationMethods do
end
end
end
end

View file

@ -1,5 +1,7 @@
require 'spec_helper'
if defined? ActiveRecord
describe 'default per_page' do
describe 'AR::Base' do
subject { ActiveRecord::Base }
@ -27,3 +29,4 @@ describe 'default per_page' do
end
end
end
end

View file

@ -1,5 +1,7 @@
require 'spec_helper'
if defined? ActiveRecord
shared_examples_for 'the first page' do
it { should have(25).users }
its('first.name') { should == 'user001' }
@ -161,3 +163,4 @@ describe Kaminari::ActiveRecordExtension do
end
end
end
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
require 'dm-core'
require 'dm-migrations'
require 'dm-aggregates'
if defined? DataMapper
require 'kaminari/models/data_mapper_extension'
describe Kaminari::DataMapperExtension do
@ -181,3 +180,4 @@ describe Kaminari::DataMapperExtension do
end
end
end
end

View file

@ -1,4 +1,6 @@
require 'spec_helper'
if defined? MongoMapper
require 'mongo_mapper'
require 'kaminari/models/mongo_mapper_extension'
@ -84,3 +86,4 @@ describe Kaminari::MongoMapperExtension do
it { should skip 10 }
end
end
end

View file

@ -1,4 +1,6 @@
require 'spec_helper'
if defined? Mongoid
require 'mongoid'
require 'kaminari/models/mongoid_extension'
@ -143,3 +145,4 @@ describe Kaminari::MongoidExtension do
end
end
end
end