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

在使用devise这个gem时,编写控制器层的单元测试,你需要在你的rspec帮助文件 rails_helper.rb里添加下面这一样

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

  

posted on 2017-04-06 15:34  c3tc3tc3t  阅读(422)  评论(0编辑  收藏  举报