On 4 Nov 2008, at 20:46, Fernando Perez wrote:
Are the docs on mock outdated? I sometimes see mock_model, and
sometimes
mock. Which one should be used?
For mock_model, you need to look at the rspec-rails gem, which is a
separate library.
You actually have three choices when mocking an ActiveRecord model:
mock, mock_model and stub_model. mock() belongs to rspec's core
library, while the latter two come with the rails-specific extension
gem.
See here for the documentation on the two rails mocking methods:
http://rspec.rubyforge.org/rspec-rails/1.1.11/classes/Spec/Rails/Mocks.html#M000026
There's also a good blog post on David's blog about stub_model
http://blog.davidchelimsky.net/2008/5/27/rspec-1-1-4
HTH,
Matt
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users