I\'m using Rails 5, and Devise 3.5.1.
Going through a nice (older) book about creating/testing an API, which uses Devise authentication. It was written before Rails
You could add the following to your rails_helper:
rails_helper
RSpec.configure do |config| config.include Devise::Test::ControllerHelpers, type: :controller end
This will include Devise::Test::ControllerHelpers module in all :controller specs.
Devise::Test::ControllerHelpers
:controller