Helper Devise: could not find the `Warden::Proxy` instance on request environment

c3tc3tc3t發表於2017-04-06

在使用devise這個gem時,編寫控制器層的單元測試,你需要在你的rspec幫助檔案 rails_helper.rb裡新增下面這一樣

RSpec.configure do |config|
  config.include Devise::Test::ControllerHelpers, type: :controller
end

  

相關文章