Most Rails tests don't need stubs or mocks, but in this context, an example where you might need it is to mock a model in a controller or integration test.
Since controllers typically manipulate models, you will sometimes want to verify the model has been called in a certain way. You can usually do this just by asserting against the model's state, after the controller has been invoked, but occasionally you may wish to verify the actual call made from controller to model. In this case, you "mock" the model using a Ruby mocking library and setup the expectation prior to calling the controller. The test will fail if the expected model method wasn't called.
Another motivation may be to fake some data being returned, in which case you would "stub" the model. Stubbing is just mocking without any kind of assertion, you can prepare some fake behaviour.