Chronicling my experiences with ruby on rails, web application development/management.

Monday, June 22, 2009

Important Cucumber step that must not be missed!

Ok, this may just be an aha moment for myself, but i always thought that when i looked at ryan's screencasts on Cucumber we're overly weird. That's right, i said it.

Now, why were they weird? Well, he started out his steps by including the following kind of Given statements:
Given I have zero articles
# or
Given I have an article named "Cheese"

Without this step at this time, there is no way to follow a article_path("blah") link at all. In my simple mind's eye, i thought there would be.

Lessoned Learned?

Stop being a moron and setup your Given statement to either start with a record or two for the model you are trying to BDD against, or make sure NONE exist, to start with a clean slate.

No comments:

Post a Comment