On Thu, Jul 16, 2009 at 7:46 AM,
internetchris<chris at silhouettesolutions.net> wrote:
> Tom,
>> I appreciate the reply...
>> So would I be correct in saying that I should develop all of my spec
> tests first, and then finish it up by running some cucumber tests?
>> Thanks!
>> Chris
>
Chris
If you follow strict Behaviour Driven Development, then the behaviour
should be defined before the code. Therefore, the Cucumber scenarios
should come first.
My workflow is like this:
Write Cucumber scenario - It will fail because the path isn't defined
Create route entry
Run Cucumber - It now fails because the controller doesn't exist
Create controller spec - It will fail because there's no controller
Create controller
Spec now fails because required model doesn't exist
Write model spec - It will fail because model doesn't exist
Create model
Flesh out model until model spec passes
Flesh out controller until controller spec passes
Continue until Cucumber scenario passes
Repeat until project is complete :-)
I run autospec so most of the test re-runs are done automatically and
therefore the process continues a lot more smoothly than it sounds.
You'll notice that their are no view specs. I don't use view specs 95%
of the time because Cucumber covers this (previously my view specs
where just an assertion that the view was there).
When theirs something very specific I need to ensure is in the view, I
might add a view spec.
Andrew Timberlake
http://ramblingsonrails.comhttp://MyMvelope.com - The SIMPLE way to manage your savings