mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
spec for last_page? and first_page?
Conflicts: spec/models/scopes_spec.rb
This commit is contained in:
parent
b61d5a6568
commit
32aceb7b7a
1 changed files with 24 additions and 0 deletions
|
@ -94,6 +94,30 @@ describe Kaminari::ActiveRecordExtension do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#first_page?' do
|
||||
context 'on first page' do
|
||||
subject { User.page(1).per(10) }
|
||||
its(:first_page?) { should == true }
|
||||
end
|
||||
|
||||
context 'not on first page' do
|
||||
subject { User.page(5).per(10) }
|
||||
its(:first_page?) { should == false }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#last_page?' do
|
||||
context 'on last page' do
|
||||
subject { User.page(10).per(10) }
|
||||
its(:last_page?) { should == true }
|
||||
end
|
||||
|
||||
context 'not on last page' do
|
||||
subject { User.page(1).per(10) }
|
||||
its(:last_page?) { should == false }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#count' do
|
||||
context 'page 1' do
|
||||
subject { User.page }
|
||||
|
|
Loading…
Reference in a new issue