1
0
Fork 0
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:
Akira Matsuda 2011-04-25 17:14:00 +09:00
parent b61d5a6568
commit 32aceb7b7a

View file

@ -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 }