[rspec-users] Cucumber step or model spec?

Lee Hambley lee.hambley at gmail.com
Mon Jul 20 19:01:30 EDT 2009

My take on this is that if your business user wants to make sure that there
are only active products displayed, then it should be in a story.

There may be a question about speccing the implementation; however if you
are using a named scope - you might argue that you are testing a library
(and thus, you shouldn't bother, as the library should test itself.) I would
consider a simple spec for named scope to prove that it works.

With the named scope tested you can mention it incidentally in your story
and not get too hung up on the exact details.

I've just noticed I've been writing this draft for so long, David C has also
answered, I am as interested as you to read that, so HTH.

-- Lee Hambley

Twitter: @leehambley
Blog: http://lee.hambley.name/
Working with Rails: http://is.gd/1s5W1

2009/7/20 Marcelo de Moraes Serpa <celoserpa at gmail.com>

> Hello list,
>  I have an example/spec that relates to the Product#index view and
> says "it should display only the active products". The thing is the
> logic to filter the active products should be in the model, and not on
> the view, since the view should be "dumb". I just realized that, and
> what I think is, even though this statement has business value, it is
> not lower level enough to be a view spec, nor a model or controller
> spec -- it should be a cucumber step, if any.
> Could someone enlighten-me, here? :)
> Thanks in advance,
> Marcelo.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090721/621a6f47/attachment.html>

More information about the rspec-users mailing list