[rspec-users] Best approach to spec'ing this

Matt Riches mattriches at gmail.com
Mon Feb 22 13:54:02 EST 2010

I am hoping that this is an easy question to answer!

I have 2 models, related via an association model, such that models a and b
use has_many to refer to each other, and also the association.

(Thats as simple as the code is)

When I try to write a simple spec to access model 2 from model 1 I am
getting a failure "uninitialized constant in Model1::Association

Before I go back to this tomorrow, what is the best way of speccing models
that are connected via associations. Should I be Mocking and stubbing the
assosciation model and the child model, or requiring the actual models, and
pulling some seed data in form the database?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100222/b07a5585/attachment.html>

More information about the rspec-users mailing list