Sha256: 2c8b5dbe4c38b235325d4b06f71c87b228163d0c011422ff439b7f1f0c35d9f7

Contents?: true

Size: 917 Bytes

Versions: 25

Compression:

Stored size: 917 Bytes

Contents

require 'rails_helper'

module ActiveAdmin
  describe Resource, "Pagination" do

    before { load_defaults! }

    let(:application){ ActiveAdmin::Application.new }
    let(:namespace){ Namespace.new(application, :admin) }

    def config(options = {})
      @config ||= Resource.new(namespace, Category, options)
    end

    describe "#paginate" do
      it "should default to true" do
        expect(config.paginate).to eq true
      end

      it "should be settable to false" do
        config.paginate = false
        expect(config.paginate).to eq false
      end
    end

    describe "#per_page" do
      it "should default to namespace.default_per_page" do
        expect(namespace).to receive(:default_per_page).and_return(5)
        expect(config.per_page).to eq 5
      end

      it "should be settable" do
        config.per_page = 5
        expect(config.per_page).to eq 5
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/resource/pagination_spec.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.17.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.16.pre spec/unit/resource/pagination_spec.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/resource/pagination_spec.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/resource/pagination_spec.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.15.pre spec/unit/resource/pagination_spec.rb
activeadmin-orac-1.0.0.pre4 spec/unit/resource/pagination_spec.rb
activeadmin-orac-1.0.0 spec/unit/resource/pagination_spec.rb
activeadmin-orac-1.0.0.pre.orac spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.14.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.13.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.12.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.11.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.10.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.9.pre spec/unit/resource/pagination_spec.rb
yousty-activeadmin-1.0.8.pre spec/unit/resource/pagination_spec.rb
activeadmin-1.0.0.pre4 spec/unit/resource/pagination_spec.rb
activeadmin-1.0.0.pre3 spec/unit/resource/pagination_spec.rb