Sha256: 3f503f78708ec68bbe6ffad82468636314e964bcd1b5c7571ef6b45308320fd1

Contents?: true

Size: 666 Bytes

Versions: 7

Compression:

Stored size: 666 Bytes

Contents

require File.expand_path('../spec_helper', File.dirname(__FILE__))

describe 'default per_page' do
  subject { User.page 0 }

  context 'by default' do
    its(:limit_value) { should == 25 }
  end

  context 'when explicitly set via paginates_per' do
    before { User.paginates_per 1326 }
    its(:limit_value) { should == 1326 }
    after { User.paginates_per nil }
  end

  describe "default per_page value's independency per model" do
    context "when User's default per_page was changed" do
      before { User.paginates_per 1326 }
      subject { Book.page 0 }
      its(:limit_value) { should == 25 }
      after { User.paginates_per nil }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kaminari-0.9.13 spec/models/default_per_page_spec.rb
kaminari-0.9.12 spec/models/default_per_page_spec.rb
kaminari-0.9.10 spec/models/default_per_page_spec.rb
kaminari-0.9.9 spec/models/default_per_page_spec.rb
kaminari-0.9.8 spec/models/default_per_page_spec.rb
kaminari-0.9.7 spec/models/default_per_page_spec.rb
kaminari-0.9.6 spec/models/default_per_page_spec.rb