diff --git a/spec/models/active_record/scopes_spec.rb b/spec/models/active_record/scopes_spec.rb index 31dd3c8..46b3dbb 100644 --- a/spec/models/active_record/scopes_spec.rb +++ b/spec/models/active_record/scopes_spec.rb @@ -58,7 +58,7 @@ if defined? ActiveRecord it { should have(5).users } its('first.name') { should == 'user001' } end - + context "page 1 per nil" do subject { model_class.page(1).per(nil) } it { should have(model_class.count).users } @@ -71,6 +71,12 @@ if defined? ActiveRecord it { should have(5).users } its('first.name') { should == 'user002' } end + + context 'page 19 per 5 padding 5' do + subject { model_class.page(19).per(5).padding(5) } + its(:current_page) { should == 19 } + its(:total_pages) { should == 19 } + end end describe '#total_pages' do @@ -123,7 +129,7 @@ if defined? ActiveRecord subject { model_class.page } its(:total_pages) { should == 4 } end - + context "with per(nil)" do subject { model_class.page.per(nil) } its(:total_pages) { should == 1 } @@ -141,7 +147,7 @@ if defined? ActiveRecord subject { model_class.page(2).per 3 } its(:current_page) { should == 2 } end - + context "with per(nil)" do subject { model_class.page.per(nil) } its(:current_page) { should == 1 }