我尝试存根我的request.env
require 'spec_helper'
describe AuthenticationController do
render_views
include Devise::TestHelpers
describe "GET 'create'" do
@request.env["HTTP_REFERER"] = '/'
结果
`method_missing': undefined method `env' for nil:NilClass (NoMethodError)
如何在调用方法之前将数据放入request.env对象? 另外使用request.env =也行不通。