On Tue, Dec 4, 2012 at 3:47 AM, LesNightingill <
codeh...@comcast.net> wrote:
> I have Rails app with a helper method "current_user_permitted?" in
> app/helpers/application_helper.rb
> Since it has some complex dependencies, I want to mock it for my Rspec
> integration tests.
Not recommended (integration tests are intended to test those
dependencies), but you can use any_instance on each of the controllers
that might be used in the example:
FooController.any_instance.stub(:current_user_permitted? => true)
HTH,
David
>
> The question is:
> On what class do I need to create a mock, so that I can force this helper to
> always return true?
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To post to this group, send email to
rs...@googlegroups.com.
> To unsubscribe from this group, send email to
>
rspec+un...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/rspec/-/dSOQ4tdqr_MJ.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>