[rspec-users] How far to go with ActiveRecord unit tests without hitting the database?
davidj503 at gmail.com
Sun Sep 16 01:20:21 EDT 2007
I'm currently try to push my limits a little bit with some of my unit
testing -- trying to avoid saving ActiveRecord objects to the database and
take advantage of mock/stub objects.
How far should I expect to get in this direction? From what I can tell,
ActiveRecord seems to fight me when it comes to associations. In other
words, many associations seem to require database queries.
Have others had success in mocking/stubbing associations? In particular,
have you had luck with has_many :through?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users