mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
a bit more meaningful test case
This commit is contained in:
parent
d3e2f4e552
commit
cacb646002
1 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,7 @@ describe Kaminari::MongoidExtension do
|
||||||
before :all do
|
before :all do
|
||||||
class Developer
|
class Developer
|
||||||
include ::Mongoid::Document
|
include ::Mongoid::Document
|
||||||
field :value, :type => Integer
|
field :salary, :type => Integer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
before do
|
before do
|
||||||
|
@ -42,8 +42,8 @@ describe Kaminari::MongoidExtension do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with criteria before' do
|
context 'with criteria before' do
|
||||||
subject { Developer.where(:value => 1).page 2 }
|
subject { Developer.where(:salary => 1).page 2 }
|
||||||
its(:selector) { should == {:value => 1} }
|
its(:selector) { should == {:salary => 1} }
|
||||||
its(:current_page) { should == 2 }
|
its(:current_page) { should == 2 }
|
||||||
its(:limit_value) { should == 25 }
|
its(:limit_value) { should == 25 }
|
||||||
its(:num_pages) { should == 12 }
|
its(:num_pages) { should == 12 }
|
||||||
|
@ -51,8 +51,8 @@ describe Kaminari::MongoidExtension do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with criteria after' do
|
context 'with criteria after' do
|
||||||
subject { Developer.page(2).where(:value => 1) }
|
subject { Developer.page(2).where(:salary => 1) }
|
||||||
its(:selector) { should == {:value => 1} }
|
its(:selector) { should == {:salary => 1} }
|
||||||
its(:current_page) { should == 2 }
|
its(:current_page) { should == 2 }
|
||||||
its(:limit_value) { should == 25 }
|
its(:limit_value) { should == 25 }
|
||||||
its(:num_pages) { should == 12 }
|
its(:num_pages) { should == 12 }
|
||||||
|
|
Loading…
Reference in a new issue