[rspec-devel] Stories vs. examples

Bryan Helmkamp bryan at brynary.com
Wed Nov 7 13:47:49 EST 2007


On Nov 7, 2007, at 1:23 PM, Pat Maddox wrote:
> But, that's a business process, and needs to be captured in a story.
> So basically this all boils down to me wondering if I need to move
> more stuff - particularly interactions with business objects - into
> stories.


I've been preferring declarative stories to imperative stories. So  
instead of:

Given an empty checking and savings account
And visiting the Money Transfer page
And typing transfer amount $20
And selecting from account "Checking"
And selecting to account "Savings"
When clicking "Transfer"
Then user should see error message "Insufficient funds"
And checking account should have balance $0
And savings accounts should have balance $0

What about:

Given an empty checking and savings account
When user tries transferring $20 from checking to savings
Then user should see message "Insufficient funds"
And checking account should have balance $0
And savings accounts should have balance $0

The clicks, typing and selects still happen behind the scenes, but  
aren't really important at the story level.

WDYT?

-Bryan

--
http://brynary.com -- My blog



More information about the rspec-devel mailing list