Why is my RSpec not loading Devise::Test::ControllerHelpers?

前端 未结 3 1458
失恋的感觉
失恋的感觉 2020-12-14 00:07

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

3条回答
  •  星月不相逢
    2020-12-14 00:49

    You could add the following to your 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.

提交回复
热议问题