Sha256: 7e276499ae31651a9685fb770f382fc41b2002aa344e7e657f3884207c937b2f

Contents?: true

Size: 1.56 KB

Versions: 52

Compression:

Stored size: 1.56 KB

Contents

shared_examples_for "ActiveAdmin::Config" do
  describe "namespace" do
    it "should return the namespace" do
      config.namespace.should == namespace
    end
  end

  describe "page_presenters" do
    it "should return an empty hash by default" do
      config.page_presenters.should == {}
    end
  end

  it { respond_to :controller_name }
  it { respond_to :controller }
  it { respond_to :route_prefix }
  it { respond_to :route_collection_path }
  it { respond_to :comments? }
  it { respond_to :belongs_to? }
  it { respond_to :action_items? }
  it { respond_to :sidebar_sections? }

  describe "Naming" do
    it "implements #resource_label" do
      expect { config.resource_label }.should_not raise_error
    end

    it "implements #plural_resource_label" do
      expect { config.plural_resource_label }.should_not raise_error
    end
  end

  describe "Menu" do
    describe "#menu_item_options" do

      it "initializes a new menu item with defaults" do
          config.menu_item_options[:label].call.should == config.plural_resource_label
      end

      it "initialize a new menu item with custom options" do
        config.menu_item_options = { :label => "Hello" }
        config.menu_item_options[:label].should == "Hello"
      end

    end

    describe "#include_in_menu?" do
      it "should be included in menu by default" do
        config.include_in_menu?.should == true
      end

      it "should not be included in menu when menu set to false" do
        config.menu_item_options = false
        config.include_in_menu?.should == false
      end
    end

  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.116 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.94 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.92 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.90 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.84 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.80 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.79 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.78 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.77 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.74 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.73 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.72 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.71 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.66 vendor/deps/active_admin/spec/unit/config_shared_examples.rb
lalala-4.0.0.dev.65 vendor/deps/active_admin/spec/unit/config_shared_examples.rb