[rspec-users] Advice with Model tests

Rodrigo Alvarez Fernández papipo at gmail.com
Thu Dec 21 09:48:47 EST 2006


I'm developing a rails applicaton with specify-before approach, with
nice results so far.

I use mocks and stubs in both Controller and views tests, but the main
issue is with model testing. Since I've seen many examples here and
there, I don't know if the right way is to use fixtures or not at all
(in model specs).

Atm, I'm using them, but I don't know if I should use mocks for
associations, all real fixture data...

This example http://rspec.rubyforge.org/documentation/rails/writing/models.html
uses both approachs (data generated on setup (but no mocks), and data
from fixtures).

Please, help me!

Apart from that, I really like this way of testing. I just want to do
it the right way.


More information about the rspec-users mailing list