[rspec-users] When to mock

Jonathan Kinney jonkinney at gmail.com
Tue Aug 19 09:38:11 EDT 2008

I noticed that the examples on the rspec website for model code
http://rspec.info/documentation/rails/writing/models.html have no mocks or
stubs. However both the controller example and view example do have mocks
and stubs implemented. I was having some problems getting mocks to work in
my model (using mock_model and passing in a hash or stubs) but I'm wondering
if I shouldn't be mocking or stubbing in my model at all? I've done the
googling on mocks vs stubs and read a bunch or info, I'm just wondring how
some of the fellow rspec users implement mocking and stubbing in their specs
and whether or not it is ok to mock and or stub in a model?

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

More information about the rspec-users mailing list