[rspec-users] Plain Text Stories Chaining Scenarios

Nathan Sutton fowlduck at gmail.com
Wed Nov 14 22:01:34 EST 2007


I'm writing a plain text story (testing the waters) and I have  
scenarios that I need to chain in my specs.

Here is what I have so far:

Story: User purchasing tshirts
   As a user
   I want to checkout
   So that I can purchase shirts

   Scenario: User goes to checkout with nothing in cart
     Given a user
     And user has an empty cart
     When user goes to checkout
     Then user should see the page: site index
     And page should include the text: you have nothing in your cart

   Scenario: Logged-in user goes to checkout
     Given a logged-in user
     And user has a cart with items in it
     When user goes to checkout
     Then user should see the page: address entry

   Scenario: Anonymous user goes to checkout
     Given an anonymous user
     And user has a cart with items in it
     When user goes to checkout
     Then user should see the who are you page

   Scenario: Anonymous user continues as guest from 'who are you' page
     Given an anonymous user
     And user has a cart with items in it
     And user is at the page: who are you
     When user continues as a guest
     Then user should see the page: address entry
     And page should include the text: guest

   Scenario: Anonymous user decides to sign-up at 'who are you' page
     Given an anonymous user
     And user has a cart with items in it
     And user is at the page: who are you
     When user goes to sign-up
     Then user should see the page: sign-up

   Scenario: Registered user decides to login at 'who are you' page
     Given an anonymous user
     And user has a cart with items in it

     And user is at the page: who are you
     When user goes to login
     Then user should see the page: login

   Scenario: Registered user logs in and is returned to checkout
     Given an anonymous user
     And user has a cart with items in it
     and user is at the page: login
     When user logs in
     Then user should see the page: address entry

   Scenario: Anonymous user signs-up and is returned to checkout
     Given an anonymous user
     And user has a cart with items in it
     And user is at the page: sign-up
     When user signs-up
     Then user should see the page: address entry

The parts that I need to chain are the last four scenarios.  I want to  
make sure that when they leave to signup and log in that they're  
returned to the next step in checkout.  How would I go about doing  
this in the stories?  Would that just be another given?

Also, how do the rest look, sane?

Thanks,

Nate


More information about the rspec-users mailing list