Sha256: c3d49023a7d765c0620d4c1f1e2b56bccb7fcd1bdf4fe22b3cf9fa8aca4c03c1

Contents?: true

Size: 734 Bytes

Versions: 4

Compression:

Stored size: 734 Bytes

Contents

# Required methods:
#   * controller_class
#   * controller
#
shared_examples_for "BaseController" do
  let(:controller_class) { described_class }

  describe "Menu" do
    describe "setting the current tab" do
      before do 
        controller.stub!(:active_admin_config => resource, :parent? => true)
        controller.send :set_current_tab # Run the before filter
      end
      subject{ controller.instance_variable_get(:@current_tab) }

      context "when menu item name is 'Resources' without a parent menu item" do
        let(:menu_item){ stub }
        let(:resource){ mock(:menu_item => menu_item, :parent_menu_item_name => nil, :belongs_to? => false) }
        it { should == menu_item }
      end

    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activeadmin-0.5.1 spec/unit/base_controller_shared_examples.rb
activeadmin-0.5.0 spec/unit/base_controller_shared_examples.rb
activeadmin-0.5.0.pre1 spec/unit/base_controller_shared_examples.rb
activeadmin-0.5.0.pre spec/unit/base_controller_shared_examples.rb