[rspec-users] Before and After blocks for individual feature files?

Kero van Gelder kero at chello.nl
Tue Apr 28 19:11:22 EDT 2009


> I'd like to do this:
> 
>   Feature: user signup
>   Before:
>     Given I have a cleaned up database
>   Scenario Outline: Sign Up
>     Given I am on the signup page
>     When I sign up using <userid>
>     Then I should see <message>
>    Examples:
>     |userid     |message           |
>     |userX      |successful signup |
>     |userX      |duplicate userid  |

Feature: user signup

  Scenario: succesful signup
    When I sign up using Kero
    Then I should see welcome Kero

  Scenario: failed signup of existing user
    Given there is a user Kero
    When I sign up using Kero
    Then I should see trying to impersonate someone else

NB: yes, clean the database before every scenario

Bye,
Kero.

___
How can I change the world if I can't even change myself?
  -- Faithless, Salva Mea


More information about the rspec-users mailing list