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
In the spec_helper.rb add:
spec_helper.rb
config.include Devise::Test::ControllerHelpers, :type => :controller