[rspec-users] How to stub ApplicationController method in request spec

mattf mafordha at gmail.com
Fri Sep 16 14:33:18 EDT 2011


Hey there,

I am needing to stub a 'current_user' method in an Rspec/capybara
request spec. The method is defined in ApplicationController and is
using helper_method. The method should simply return a user id.

Alternatively, I could fix my problem by setting 'session[:user_id]'
in the spec (which is what 'current_user' returns)... but that doesn't
seem to work either.

Are either of these possible? Thanks!!!


More information about the rspec-users mailing list