What is the expected behavior when a model has both stub and
should_receive defined for the same method?
I have a helper method which creates an admin “logged in”:
user = stub_model(User)
@admin = stub_user(true)
session[:user_id] = @admin.id
In an admin controller spec, I have to setup_admin so the specs can get
to the controllers, but then later in particular contexts, I do
@some_user = stub_model(User)
This is to simulate selecting a user from a list and either showing or
editing details. Based on what I’m seeing, it appears that the the
find_by_id return values are getting mixed up. Am I wrong to attempt to
use both of these or should this work as I expect? If the latter, then I
have more digging to do to determine what’s going wrong.