Sha256: 60b5a1c87c9cb7dbe3a147a1e3859f36b153af7c70faa18610a1d237ef8cd833

Contents?: true

Size: 1.95 KB

Versions: 13

Compression:

Stored size: 1.95 KB

Contents

Feature: Menu

  Background:
    Given I am logged in

  Scenario: Hide the menu item
    Given a configuration of:
    """
      ActiveAdmin.register Post do
        menu false
      end
    """
    When I am on the dashboard
    Then I should not see a menu item for "Posts"

  Scenario: Set the menu item label
    Given a configuration of:
    """
      ActiveAdmin.register Post do
        menu label: "Articles"
      end
    """
    When I am on the dashboard
    Then I should see a menu item for "Articles"
    And I should not see a menu item for "Posts"

  Scenario: Add a non-resource menu item
    Given a configuration of:
    """
      ActiveAdmin.application.namespace :admin do |admin|
        admin.build_menu do |menu|
          menu.add label: "Custom Menu", url: :admin_dashboard_path
        end
      end
    """
    When I am on the dashboard
    Then I should see a menu item for "Custom Menu"
    When I follow "Custom Menu"
    Then I should be on the admin dashboard page

  Scenario: Adding a resource as a sub menu item
    Given a configuration of:
    """
      ActiveAdmin.register User
      ActiveAdmin.register Post do
        menu parent: 'Users'
      end
    """
    When I am on the dashboard
    Then I should see a menu item for "Users"
    And I should not see a menu item for "Posts"
    When I follow "Users"
    Then the "Users" tab should be selected
    And I should see a nested menu item for "Posts"

  Scenario: Adding a resources as a sub menu items
    Given a configuration of:
    """
      ActiveAdmin.register Category do
        menu parent: 'Anything'
      end
      ActiveAdmin.register Post do
        menu parent: 'Anything'
      end
    """
    When I am on the dashboard
    Then I should see a menu item for "Anything"
    And I should not see a menu item for "Categories"
    And I should not see a menu item for "Posts"
    And I should see a nested menu item for "Categories"
    And I should see a nested menu item for "Posts"

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin-1.3.1 features/menu.feature
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin-1.3.0 features/menu.feature
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/menu.feature
activeadmin-1.2.1 features/menu.feature
activeadmin-1.2.0 features/menu.feature
activeadmin-1.1.0 features/menu.feature
activeadmin-1.0.0 features/menu.feature