Sha256: 2c40e830293366b9e052b60c04a1f28930443e29a2d051cd838e4074993c5a13

Contents?: true

Size: 781 Bytes

Versions: 18

Compression:

Stored size: 781 Bytes

Contents

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

describe 'default per_page' do
  describe 'AR::Base' do
    subject { ActiveRecord::Base }
    it { should_not respond_to :paginates_per }
  end

  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

18 entries across 18 versions & 5 rubygems

Version Path
wulffeld_kaminari-0.12.4.2 spec/models/default_per_page_spec.rb
wulffeld_kaminari-0.12.4.1 spec/models/default_per_page_spec.rb
sayso-kaminari-0.12.4.001 spec/models/default_per_page_spec.rb
dimkiriyenko-kaminari-0.12.6 spec/models/default_per_page_spec.rb
dimkiriyenko-kaminari-0.12.5 spec/models/default_per_page_spec.rb
dimkiriyenko-kaminari-0.12.4 spec/models/default_per_page_spec.rb
kaminari-0.12.4 spec/models/default_per_page_spec.rb
kaminari-0.12.3 spec/models/default_per_page_spec.rb
kaminari-0.12.2 spec/models/default_per_page_spec.rb
kaminari-0.12.1 spec/models/default_per_page_spec.rb
kaminari-0.12.0 spec/models/default_per_page_spec.rb
kaminari-0.11.0 spec/models/default_per_page_spec.rb
zhanghd_kaminari-0.10.4.1 spec/models/default_per_page_spec.rb
kaminari-0.10.4 spec/models/default_per_page_spec.rb
kaminari-0.10.3 spec/models/default_per_page_spec.rb
kaminari-0.10.2 spec/models/default_per_page_spec.rb
kaminari-0.10.1 spec/models/default_per_page_spec.rb
kaminari-0.10.0 spec/models/default_per_page_spec.rb