mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Add failing tests with padding
This commit is contained in:
parent
5f62aa5966
commit
15ea8867c9
1 changed files with 9 additions and 3 deletions
|
@ -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 }
|
||||
|
|
Loading…
Reference in a new issue