Skip to content

Instantly share code, notes, and snippets.

@radamant
Created March 30, 2009 04:59
Show Gist options
  • Save radamant/87635 to your computer and use it in GitHub Desktop.
Save radamant/87635 to your computer and use it in GitHub Desktop.
Is this really how cucumber .features _should_ be?
# Taken from RESTful authentication cucumber features
Scenario: Anonymous user can not create an account with bad email
Given an anonymous user
And no user with login: 'Oona' exists
When she registers an account with login: 'oona', password: 'monkey', password_confirmation: 'monkey' and email: ''
Then she should be at the 'users/new' page
And she should see an errorExplanation message 'Email can't be blank'
And no user with login: 'oona' should exist
When she registers an account with login: 'oona', password: 'monkey', password_confirmation: 'monkey' and email: '[email protected]'
Then she should be redirected to the home page
When she follows that redirect!
Then she should see a notice message 'Thanks for signing up!'
And a user with login: 'oona' should exist
And the user should have login: 'oona', and email: '[email protected]'
And oona should be logged in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment