[rspec-users] Newbie question with rspec on rails
pergesu at gmail.com
Mon Feb 4 02:20:48 EST 2008
On Feb 3, 2008 9:32 AM, herding <rick.walsh at gmail.com> wrote:
> I'm just startingwith Rspec with the rails framework.
> I have a question regarding contexts.
> If I use a generator for a model, for example, user, I get a user_spec which
> I can place rspec specs.
> Should I be only having one file per model? What is the convention for
> naming and creating specs when speccing out cross object behaviour?
> Really appreciate your thoughts.
> Also, can anybody recommend any good books or tutorials on Rspec?
> Many thanks!
You don't necessarily have to have one spec file per model. It's a
pretty convenient convention though (and I just noticed for the first
time in my life that convenient and convention have the same root).
You can do whatever you want to keep your specs organized, but I've
found that I don't often need to use multiple files to spec the same
As for tutorials, I'd recommend watching the peepcode vids. They do a
great job of demonstrating the technical use of RSpec, though they're
a bit light on the conceptual stuff. For some info on why BDD kicks
TDD's butt, I would check out
More information about the rspec-users