Sha256: 9d57f1875fc5d197e06f8896fc35a2c2a9e628dc0f866f711fe56b9fc3f6ec4b

Contents?: true

Size: 1.75 KB

Versions: 46

Compression:

Stored size: 1.75 KB

Contents

Feature: Belongs To

  A resource belongs to another resource

  Background:
    Given I am logged in
    And a post with the title "Hello World" written by "John Doe" exists
    And a post with the title "Hello World" written by "Jane Doe" exists

  Scenario: Viewing the child resource index page
    Given a configuration of:
    """
      ActiveAdmin.register User
      ActiveAdmin.register Post do
        belongs_to :user
      end
    """
    When I go to the last author's posts
    Then the "Users" tab should be selected
    And I should not see a menu item for "Posts"
    And I should see "Displaying 1 Post"
    And I should see a link to "Users" in the breadcrumb

  Scenario: Viewing a child resource page
    Given a configuration of:
    """
      ActiveAdmin.register User
      ActiveAdmin.register Post do
        belongs_to :user
      end
    """
    When I go to the last author's posts
    And I follow "View"
    Then I should be on the last author's last post page
    And the "Users" tab should be selected

  Scenario: When the belongs to is optional
    Given a configuration of:
    """
      ActiveAdmin.register User
      ActiveAdmin.register Post do
        belongs_to :user, :optional => true
      end
    """
    When I go to the last author's posts
    Then the "Users" tab should be selected
    And I should see a menu item for "Posts"

    When I follow "Posts"
    Then the "Posts" tab should be selected

  Scenario: Displaying belongs to resources in main menu
    Given a configuration of:
    """
      ActiveAdmin.register User
      ActiveAdmin.register Post do
        belongs_to :user
        navigation_menu :user
      end
    """
    When I go to the last author's posts
    And I follow "View"
    Then the "Posts" tab should be selected

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.136 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.135 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.134 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.133 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.132 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.131 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.129 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.128 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.126 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.125 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.124 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.123 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.118 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.116 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.114 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.113 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.111 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.109 vendor/deps/active_admin/features/belongs_to.feature
lalala-4.0.0.dev.107 vendor/deps/active_admin/features/belongs_to.feature