Skip to content

Commit

Permalink
Refactored further to check for our error class and message
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jun 18, 2010
1 parent 74dab11 commit e9b560d
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions features/plain/feature_form_validation.feature
Expand Up @@ -2,34 +2,21 @@ Feature: Feature forms should have client side validations
In order to improve the performance of the salad
As a system feature
I want to allow for validation of the feature forms

Scenario Outline: All validation should have an error class
Given I can view the features page
When I click new features
And we fill in the <model> <property> with '<value>'
Then submit the form
And the "<model>" "<property>" "<input_type>" should have an error class

Examples: Models and their properties
| model | value | property | input_type |
| feature | to | title | input |
| feature | to do | in_order | input |
| feature | use | as_a | input |
| feature | not | i_want | input |

Scenario Outline: Feature fields that need validation should display the appropriate error message

Scenario Outline: Feature fields that need validation should display the appropriate error message and error class
Given I can view the features page
When I click new features
And we fill in the feature <property> with '<value>'
Then submit the form
And I should see "Please enter at least <number> characters." within "<selector>"
And the "<model>" "<property>" "<input_type>" should have an error class

Examples: Form fields and their error messages
| property | value | number | selector |
| title | to | 6 | li#feature_title_input |
| in_order | to do | 7 | li#feature_in_order_input |
| as_a | use | 4 | li#feature_as_a_input |
| i_want | not | 7 | li#feature_i_want_input |
| model | property | value | number | selector | input_type |
| feature | title | to | 6 | li#feature_title_input | input |
| feature | in_order | to do | 7 | li#feature_in_order_input | input |
| feature | as_a | use | 4 | li#feature_as_a_input | input |
| feature | i_want | not | 7 | li#feature_i_want_input | input |

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

0 comments on commit e9b560d

Please sign in to comment.