diff --git a/spec/models/scopes_spec.rb b/spec/models/scopes_spec.rb index 5c3717b..e08fe34 100644 --- a/spec/models/scopes_spec.rb +++ b/spec/models/scopes_spec.rb @@ -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 }