I'm working on writing features for a wizard. The wizard collects
information from a number of different forms, and you can navigate through
it in a number of ways. Anyhow one of these forms is a customer form
collecting name, and email.
In the context of the wizard I feel that the following scenarios
Scenario:
Given I step to customer
And I fill in my customer details correctly
Scenario:
Given I step to customer
And I fill in my customer details incorrectly
Then I should see an error
are preferable to
Scenario:
Given I step to customer
And I fill in email with [EMAIL PROTECTED]
And I fill in name "Fred Bloggs"
Given I step to customer
And I fill in email with ''
And I fill in name "Fred Bloggs"
Then I should see an error
# add table for different combinations of form fields that cause errors
# consider checking that errors are appropriate
note: Given I step to customer is nested step doing all sorts to get to the
form
What do you think?
I'm looking for some input on this, and in particular am wondering where
should I put the more specific tests for form validation, error messages
etc. in my test hierarchy, or even if I should test them at all (could you
argue they're in built rails functionality).
All best
Andrew
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users