Hi all,
I’m using rspec-caching-test-plugin to test caching (obviously) in my
controller specs. Because views are also involved in caching
integrate_views
have to be turned On.
The problem comes when mock is passed to a helper, for examle
link_to_profile(profile)
where porfile = mock_model(Profile)
The error thrown is “can’t convert Spec::Mocks::Mock into String”.
Usually
when dealing with view specs in this case I’m just doing
template.stub!(:link_to_profile => ‘/link/to/profile’)
and specing the helper method in separate helper spec, but in this case
(controller spec with integrate_views turned On) I have no access to
template object.
Is there any way to stub helper method or I just have to give away mocks
and
use real records created with FactoryGirl instead?
Regards,
K.