[rspec-devel] Stories vs. examples

Pat Maddox pergesu at gmail.com
Wed Nov 7 18:17:44 EST 2007


On Nov 7, 2007 10:47 AM, Bryan Helmkamp <bryan at brynary.com> wrote:
> 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?

That really isn't anything like what I was discussing :)  but I agree
that the second form is much better imo.

Pat


More information about the rspec-devel mailing list