According to this from the devise wiki I should be able to use a login_user helper method in my controller tests. Accordingly I have the following within the spec directory:
I imagine there are a couple of problems with this approach. First is that you're using request specs, not controller specs, so the login_user
method is not made available by config.extend ControllerMacros, :type => :controller
. Second, even if you are able to include the method it most likely won't work anyway, since the Devise test helpers are specifically written for controller/view tests, not integration tests.
Take a look at David Chelimsky's answer to this SO question, which may be of help.