Sha256: 056a50972164c84d07157160dea2dc7ab996509b3894c80fdd53a336ab96a97d

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

Feature: Index - Page Title

  Modifying the page title on the index screen

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

  Scenario: Set the title using a proc
    Given an index configuration of:
    """
      ActiveAdmin.register Post do
        index title: proc{ 'Custom title from proc' }
      end
    """
    Then I should see the page title "Custom title from proc"

  Scenario: Set the title using a proc that uses the available resource class
    Given an index configuration of:
    """
      ActiveAdmin.register Post do
        index title: proc{ "List of #{resource_class.model_name.plural}" }
      end
    """
    Then I should see the page title "List of posts"

  Scenario: Set the title in controller
    Given an index 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

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-1.0.0.pre5 features/index/page_title.feature