Use default_per_page value when per(nil)

closes #356
This commit is contained in:
Yuki Nishijima 2013-06-18 22:37:33 +09:00
parent d79c94626c
commit 03fe8ba9b0
1 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,11 @@ if defined? ActiveRecord
it { should have(5).users }
its('first.name') { should == 'user001' }
end
context "page 1 per nil (using default)" do
subject { model_class.page(1).per(nil) }
it { should have(model_class.default_per_page).users }
end
end
describe '#padding' do
@ -124,6 +129,11 @@ if defined? ActiveRecord
subject { model_class.page }
its(:total_pages) { should == 4 }
end
context "with per(nil) using default" do
subject { model_class.page.per(nil) }
its(:total_pages) { should == 4 }
end
end
describe '#current_page' do