Skip to content

Commit

Permalink
Refactored making more DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jul 23, 2010
1 parent f6055ac commit ec0b266
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
10 changes: 5 additions & 5 deletions features/plain/feature_files.feature
@@ -1,6 +1,6 @@
Feature: We need a way to handle out feature files
In order to improve the way we handle feature imports
As Salad
As a Salad feature
I want to be able to read feature files and store its information

Scenario: A FeatureFile can gives an error if the file referenced is not a cucumber feature file
Expand All @@ -11,18 +11,18 @@ Feature: We need a way to handle out feature files
Given we create a FeatureFile from a cucumber feature file
Then the object should be valid

# @TODO Add examples for scenarios
Scenario Outline: A FeatureFile should store the 'In order' heading
Given we create a FeatureFile from a cucumber feature file
Then the object should be valid
And the '<property>' property should not be nil

Examples: List of properties that should not be nil
| property |
| feature |
| title |
| in_order |
| as_a |
| i_want |
| stories |

Scenario: A FeatureFile should store the feature files scenario's
Given we create a FeatureFile from a cucumber feature file
Expand Down Expand Up @@ -51,9 +51,9 @@ Feature: We need a way to handle out feature files
And exported features '<property>' will not contain '<prefix>' prefix
And each scenario should not be prefixed with 'Scenario:'

Examples: List of propertties that should not contain the given prefixes
Examples: List of properties that should not contain the given prefixes
| property | prefix |
| title | Feature: |
| in_order | In order |
| i_want | I want |
| as_a | As a |
| as_a | As a |
30 changes: 9 additions & 21 deletions features/plain/steps.feature
Expand Up @@ -49,27 +49,15 @@ Feature: Stories have steps, which help to define what the action taken within a
When I am on "a step"
Then I should see check boxes for all steps it can be linked to


# @TODO Move to the form validation faeture, may well be duplicate scenarios
Scenario: A step must start with 'Given' otherwise it does not validate
When I am on "new step"
And we fill in the step title with 'Given we have a new step'
Then submit the form
And the step should be saved as 'Given we have a new step'
And a flash message 'Step: Given we have a new step, was created' should be displayed

# @TODO Move to the form validation faeture, may well be duplicate scenarios
Scenario: A step must start with 'When' otherwise it does not validate
Scenario Outline: A step must start with a given prefix
When I am on "new step"
And we fill in the step title with 'When we have a new step'
And we fill in the step title with '<title>'
Then submit the form
And the step should be saved as 'When we have a new step'
And a flash message 'Step: When we have a new step, was created' should be displayed
And the step should be saved as '<title>'
And a flash message 'Step: <title>, was created' should be displayed

# @TODO Move to the form validation faeture, may well be duplicate scenarios
Scenario: A step must start with 'Then' otherwise it does not validate
When I am on "new step"
And we fill in the step title with 'Then we have a new step'
Then submit the form
And the step should be saved as 'Then we have a new step'
And a flash message 'Step: Then we have a new step, was created' should be displayed
Examples: List of valid step prefixes
| title |
| Given we have a new step |
| When we have a new step |
| Then we have a new step |

0 comments on commit ec0b266

Please sign in to comment.