Sha256: 50bd510344fea496c001a2c0dddca736362f955804e0c33689cb727bde0856fe

Contents?: true

Size: 934 Bytes

Versions: 58

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'

describe ActiveAdmin::Resource::PagePresenters do

  let(:namespace){ ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin) }
  let(:resource){ namespace.register(Post) }

  it "should have an empty set of configs on initialize" do
    resource.page_presenters.should == {}
  end

  it "should add a page presenter" do
    page_presenter = ActiveAdmin::PagePresenter.new
    resource.set_page_presenter(:index, page_presenter)
    resource.page_presenters[:index].should == page_presenter
  end

  describe "#get_page_presenter" do

    it "should return a page config when set" do
      page_presenter = ActiveAdmin::PagePresenter.new
      resource.set_page_presenter(:index, page_presenter)
      resource.get_page_presenter(:index).should == page_presenter
    end

    it "should return nil when no page config set" do
      resource.get_page_presenter(:index).should == nil
    end

  end

end

Version data entries

58 entries across 58 versions & 3 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/spec/unit/resource/page_presenters_spec.rb