Sha256: 2c799d5dee1be8574c241af88928d99bdbd592eb09d968d22c3aeb32675e7c4d

Contents?: true

Size: 1.51 KB

Versions: 21

Compression:

Stored size: 1.51 KB

Contents

Feature: Show - Page Title

  Modifying the page title on the show screen

  Background:
    Given a post with the title "Hello World" written by "Jane Doe" exists

  Scenario: Set a method to be called on the resource as the title
    Given a show configuration of:
    """
      ActiveAdmin.register Post do
        show title: :title
      end
    """
    Then I should see the page title "Hello World"

  Scenario: Set a string as the title
    Given a show configuration of:
    """
      ActiveAdmin.register Post do
        show title: "Title From String"
      end
    """
    Then I should see the page title "Title From String"

  Scenario: Set a proc as the title
    Given a show configuration of:
    """
      ActiveAdmin.register Post do
        show title: proc{|post| "Title: " + post.title }
      end
    """
    Then I should see the page title "Title: Hello World"

  Scenario: Default title
    Given a show configuration of:
    """
      ActiveAdmin.register Post
    """
    Then I should see the page title "Hello World"

  Scenario: Default title with no display name method candidate
    Given a show configuration of:
    """
      ActiveAdmin.register Tag
    """
    Then I should see the page title "Tag #"

  Scenario: Set the title in controller
    Given a show configuration of:
    """
      ActiveAdmin.register Post do
        controller do
          before_action { @page_title = "List of #{resource_class.model_name.plural}" }
        end
      end
    """
    Then I should see the page title "List of posts"

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
activeadmin-rails-1.7.2 features/show/page_title.feature
activeadmin-rails-1.7.1 features/show/page_title.feature
activeadmin-rails-1.7.0 features/show/page_title.feature
activeadmin-rb-1.6.0 features/show/page_title.feature
activeadmin-rb-1.5.2 features/show/page_title.feature
activeadmin-rb-1.5.1 features/show/page_title.feature
activeadmin-rb-1.5.0 features/show/page_title.feature
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin-rb-1.4.0 features/show/page_title.feature
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin-1.3.1 features/show/page_title.feature
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin-1.3.0 features/show/page_title.feature
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/show/page_title.feature
activeadmin-1.2.1 features/show/page_title.feature
activeadmin-1.2.0 features/show/page_title.feature
activeadmin-1.1.0 features/show/page_title.feature