Sha256: c7e71b724778a1934a9fd35ae78fa341a6551a143c8816568e09bef84fce9aad

Contents?: true

Size: 1.9 KB

Versions: 34

Compression:

Stored size: 1.9 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 "Posts" tab should be selected
    And I should not see a menu item for "Users"
    And I should see "Displaying 1 Post"
    And I should see a link to "Users" in the breadcrumb
    And I should see a link to "Jane Doe" in the breadcrumb
    When I follow "Edit"
    Then I should see a link to "Hello World" 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 "Posts" 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

34 entries across 34 versions & 6 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/features/belongs_to.feature
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/features/belongs_to.feature
yousty-activeadmin-1.0.17.pre features/belongs_to.feature
yousty-activeadmin-1.0.16.pre features/belongs_to.feature
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/features/belongs_to.feature
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/features/belongs_to.feature
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/features/belongs_to.feature
yousty-activeadmin-1.0.15.pre features/belongs_to.feature
activeadmin-orac-1.0.0.pre4 features/belongs_to.feature
activeadmin-orac-1.0.0 features/belongs_to.feature
activeadmin-orac-1.0.0.pre.orac features/belongs_to.feature
yousty-activeadmin-1.0.14.pre features/belongs_to.feature
yousty-activeadmin-1.0.13.pre features/belongs_to.feature
yousty-activeadmin-1.0.12.pre features/belongs_to.feature
yousty-activeadmin-1.0.11.pre features/belongs_to.feature
yousty-activeadmin-1.0.10.pre features/belongs_to.feature
yousty-activeadmin-1.0.9.pre features/belongs_to.feature
yousty-activeadmin-1.0.8.pre features/belongs_to.feature
activeadmin-1.0.0.pre4 features/belongs_to.feature
activeadmin-1.0.0.pre3 features/belongs_to.feature