Sha256: cd5f6a2a926d3c1b7cec330c23b731395370a3d10e7c64ba6a3a6f6f868a6c6c

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 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
          callback = ActiveAdmin::Dependency.rails >= 4 ? :before_action : :before_filter
          send(callback) { @page_title = "List of #{resource_class.model_name.plural}" }
        end
      end
    """
    Then I should see the page title "List of posts"

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
activeadmin-orac-1.0.0.pre4 features/show/page_title.feature
activeadmin-orac-1.0.0 features/show/page_title.feature
activeadmin-orac-1.0.0.pre.orac features/show/page_title.feature
activeadmin-1.0.0.pre4 features/show/page_title.feature
activeadmin-1.0.0.pre3 features/show/page_title.feature