[rspec-users] Best practices: How small to make examples?
mark at mwilden.com
Sun Apr 5 13:03:40 EDT 2009
On Sun, Apr 5, 2009 at 5:20 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
> Given I register for a conference
> Then my name should be on the list of conference attendees
> And the conference should be my list of conferences
If I were describing 'register for a conference' in this scenario,
then I would think it important to specify the steps that are used:
Given I am logged in
And I go to the registration page
And I fill in the email field
And I click "Register"
Then my name should be on the list of conference attendees
And the conference should be my list of conferences
That's the level of detail the story would have, so that's what I want
to show works.
On the other hand, this could simply be describing what appears on the
screen when I am registered for a conference (as opposed to how I got
there). In that case, the Given would simply add a database row. But
there would be a different story for the process of filling out the
Sometimes, they can be combined. But my point is that scenarios still
have to describe how the user relates to the form and 'Given I
register for a conference' doesn't do that. When you do have a
scenario that includes this level of detail, you don't need a view
spec, IMO. And you can still code step-by-step.
More information about the rspec-users