Skip to content

Commit

Permalink
Last step in refactoring this feature
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jun 18, 2010
1 parent fc57164 commit 8d1fc20
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions features/plain/feature_form_validation.feature
Expand Up @@ -17,33 +17,19 @@ Feature: Feature forms should have client side validations
| feature | use | as_a | input |
| feature | not | i_want | input |

Scenario: The "title" field should have more than 6 characters
Scenario Outline: Fields that need validation should display the appropriate error message
Given I can view the features page
When I click new features
And we fill in the feature title with 'to'
Then submit the form
And I should see "Please enter at least 6 characters." within "li#feature_title_input"

Scenario: The "in_order" field should have more than 7 characters
Given I can view the features page
When I click new features
And we fill in the feature in_order with 'to do'
Then submit the form
And I should see "Please enter at least 7 characters." within "li#feature_in_order_input"

Scenario: The "as_a" field should have more than 4 characters
Given I can view the features page
When I click new features
And we fill in the feature as_a with 'use'
And we fill in the feature title with '<value>'
Then submit the form
And I should see "Please enter at least 4 characters." within "li#feature_as_a_input"
And I should see "Please enter at least <number> characters." within "<selector>"

Scenario: The "i_want" field should have more than 7 characters
Given I can view the features page
When I click new features
And we fill in the feature i_want with 'not'
Then submit the form
And I should see "Please enter at least 7 characters." within "li#feature_i_want_input"
Examples: Form fields and their error messages
| value | number | selector |
| to | 6 | li#feature_title_input |
| to do | 7 | li#feature_in_order_input |
| use | 4 | li#feature_as_a_input |
| not | 7 | li#feature_i_want_input |

Scenario: A feature must be unique
Given I can view the features page
Expand Down

0 comments on commit 8d1fc20

Please sign in to comment.