Sha256: ea711e08c410d0dc027f24c57d998748f43f3673e91f44f765d6fc3e12713f23

Contents?: true

Size: 1.38 KB

Versions: 5

Compression:

Stored size: 1.38 KB

Contents

Feature: Index as Grid

  Viewing resources as a grid on the index page

  Scenario: Viewing index as a grid with a simple block configuration
    Given 9 posts exist
    And an index configuration of:
      """
      ActiveAdmin.register Post do
        index :as => :grid do |post|
          h2 auto_link(post)
        end
      end
      """
    Then the table ".index_grid" should have 3 rows
    And the table ".index_grid" should have 3 columns
    And there should be 9 "a" tags within "table.index_grid"

  Scenario: Viewing index as a grid and set the number of columns
    Given 9 posts exist
    And an index configuration of:
      """
      ActiveAdmin.register Post do
      index :as => :grid, :columns => 1 do |post|
          h2 auto_link(post)
        end
      end
      """
    Then the table ".index_grid" should have 9 rows
    And the table ".index_grid" should have 1 columns
    And there should be 9 "a" tags within "table.index_grid"

  Scenario: Viewing index as a grid with an odd number of items
    Given 9 posts exist
    And an index configuration of:
      """
      ActiveAdmin.register Post do
      index :as => :grid, :columns => 2 do |post|
          h2 auto_link(post)
        end
      end
      """
    Then the table ".index_grid" should have 5 rows
    And the table ".index_grid" should have 2 columns
    And there should be 9 "a" tags within "table.index_grid"

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
saulolso-activeadmin-0.2.2.1 features/index/index_as_grid.feature
saulolso-activeadmin-0.2.2 features/index/index_as_grid.feature
activeadmin-0.2.2 features/index/index_as_grid.feature
activeadmin-0.2.1 features/index/index_as_grid.feature
activeadmin-0.2.0 features/index/index_as_grid.feature