Sha256: 2894f7feb3fe7cf2514fb3f6dc6c6b59a7564c4840fd9a5f47242a9cf76d7a10

Contents?: true

Size: 1.96 KB

Versions: 7

Compression:

Stored size: 1.96 KB

Contents

@dsl
Feature: Table index view

  Background:
    Given I am logged in
    And products exists with attributes:
      | sku  | price | name  |
      | t-12 | 234   | Table |
      | dc_1 | 12    | Chair |

  Scenario: Table columns
    Given a configuration of:
      """
      class AbAdminProduct < AbAdmin::AbstractResource
        table do
          field :sku
          field :name
        end
      end
      """
    When I am on the admin products page
    Then I should see list of products

  Scenario: Columns data formatting
    Given a configuration of:
      """
      class AbAdminProduct < AbAdmin::AbstractResource
        table do
          field :sku
          field :price
          field(:picture) { |item| item_image_link(item) }
          field :created_at
          field :is_visible
          field :collection
        end
      end
      """
    When I am on the admin products page
    Then I should see pretty formatted products

  Scenario Outline: Sortable columns
    Given a configuration of:
      """
      class AbAdminProduct < AbAdmin::AbstractResource
        table do
          field :price
          field <config>
        end
      end
      """
    And I am on the admin products page
    When I follow "<column>"
    Then I should see products ordered by "<ordering>"

  Examples:
    | column | config                                                            | ordering   |
    | Sku    | :sku                                                              | sku        |
    | Name   | :name, sortable: :id                                           | id         |
    | Name   | :name, sortable: {column: :price, default_order: 'desc'} | price desc |

  Scenario: Disabled sortable column
    Given a configuration of:
      """
      class AbAdminProduct < AbAdmin::AbstractResource
        table do
          field :created_at, sortable: false
        end
      end
      """
    And I am on the admin products page
    Then I should not see "Created at" link

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ab_admin-0.3.6 features/dsl/table.feature
ab_admin-0.3.5 features/dsl/table.feature
ab_admin-0.3.4 features/dsl/table.feature
ab_admin-0.3.3 features/dsl/table.feature
ab_admin-0.3.2 features/dsl/table.feature
ab_admin-0.3.1 features/dsl/table.feature
ab_admin-0.3.0 features/dsl/table.feature