[rspec-users] Prepare for newbie-ness

Martin Streicher martin.streicher at gmail.com
Tue Sep 16 13:00:32 EDT 2008

A few questions from someone new to rspec.

1/ I have several complex yet largely independent models using rspec  
to test internals and computation methods. I am about to tackle models  
that have several ties to each other and to the "primitive",  
independent models.

One model has stuff like this:

class Message ...
   belongs_to  :contact
   belongs_to  :topic
   has_one     :header
   has_many    :parts
   has_many    :attachments

My question:

What is the best practice for testing models with these  
interdependencies? What would you recommend for Message? What about  
Topic, which has_many Messages? Do I mock these? Use canonical data in  
the code rather than use a fixture?

2/ Related to (1), I have not found much documentation about such  
techniques. Pointers? Examples? Mentorship? Blogs?

3/ Has any documented how to run the debugger via rspec to help track  
down errors?


More information about the rspec-users mailing list