Sha256: 67c111b0e2bcfe32e8faca9c61e49c60bf80bf385d4199db1adbb24fbc37bc6c

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

Feature: ActiveCucumber.attributes_for

  As a developer testing my own record create code
  I want to be able to convert Cucumber tables into attribute hashes
  So that I can use ActiveCucumber to parse Cucumber tables.

  Rules:
  - ActiveCucumbe.attributes_for(Class, table) returns the attributes of the given table as a hash
  - the creator for this class is used to parse attributes in the Cucumber table
  - related objects are getting created in the database


  Scenario: data attributes
    When running "ActiveCucumber.attributes_for Episode, table" with this table:
      | NAME | Encounter at Farpoint |
    Then it returns the hash
      """
      {
        name: 'Encounter at Farpoint'
      }
      """
    And the database contains no episodes
    And the database contains no shows


  Scenario: associated objects are built
    When running "ActiveCucumber.attributes_for Episode, table" with this table:
      | SHOW | Star Trek TNG         |
      | NAME | Encounter at Farpoint |
    Then it returns the hash
      """
      {
        show: Show.find_by(name: 'Star Trek TNG'),
        name: 'Encounter at Farpoint'
      }
      """
    And the database contains no episodes
    And the database contains the show "Star Trek TNG"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_cucumber-1.0.0 features/active_cucumber/attributes_for.feature
active_cucumber-0.2.1 features/active_cucumber/attributes_for.feature
active_cucumber-0.2.0 features/active_cucumber/attributes_for.feature