[rspec-users] Good introduction to rspec

Fernando Perez lists at ruby-forum.com
Tue Mar 31 13:59:04 EDT 2009

Pablo L. de Miranda wrote:
> Hi guys,
> Someone know some good introduction to rspec, I`m wanting to use Rspec 
> with
> my Rails projects, but I don't found a good introduction.

>From my own experience:

Write specs for your models and their class / instance methods. If you 
find yourself struggling to do that, it's probably that too much logic 
is floating in your controllers, so move it to your model as much as you 

It took me roughly 5 tries to get a hang of RSpec. By tries I mean: I 
start writing specs, then get pissed off and stop for a few 
weeks/months, then get back to it again.

Don't bother specing your controllers and views. Just stick to the 
models or you'll get pissed off.

To spec controllers and views use Cucumber and webrat, but don't dive 
into it right now.

Oh and by the way, don't use fixtures, instead write your own Factory.

Be very patient, don't try to do too much at a time, and have fun :-)
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list