What's the difference between stub_model
and mock_model
in RSpec? So far, I know that stubs are used to just prevent the real method from being called and return a predefined value, and mocks are actually expectations and require that the method is called on the receiver.
I also know that these stubs/mocks are used to allow isolated testing, such as in controllers without touching the model. But I'm still confused with these two methods, when exactly are each used? Details and examples would be very much appreciated. Thanks a lot!