I've recently came across different tutorials, where people use both mock
and mock_model
functions.
In RSpec tutorial for controllers they use the mock_model
function, but right in the documentation of RSpec, there is only mock
function, but no mock_model
I tried to run some tests myself, and I didn't find any real difference, since everything was ok when I used either of those two functions, so is there any difference at all?
Best Answer
As jenger said mock_model is an extension built for active record:
This is the source in 1.2.6:
So its quite a mouthful, but it
It also extends the model instance with a bunch of stuff.