Rspec - NoMethodError: undefined method `cookies' for Object
Rspec - NoMethodError: undefined method `cookies' for Object
尝试将 rspec 测试添加到我的应用程序并出现以下错误:
NoMethodError:
undefined method `cookies' for #
这是我的简单代码:
get :my_action, params: { id: @request.id }
expect(response.status).to eq(200)
但是我没有在我的 App 项目中使用任何地方的 cookie。为什么 'coockies' 尝试为我的 Request 模型对象执行?
可能是什么?
PS 请求 - 这是我的模型(有:title, :description)
发现错误...我有自己的模型请求,我在 RSpec 测试中使用实例变量,如:
@request = Request.create(....
但是RSpec已经使用了这个即时变量:
request
=> #<ActionController::TestRequest:0x007fa8d3b54fb8
@controller_class=RequestsController,
@custom_param_parsers=
这个问题与用我的数据重写必要的RSpec@request
有关
尝试将 rspec 测试添加到我的应用程序并出现以下错误:
NoMethodError: undefined method `cookies' for #
这是我的简单代码:
get :my_action, params: { id: @request.id }
expect(response.status).to eq(200)
但是我没有在我的 App 项目中使用任何地方的 cookie。为什么 'coockies' 尝试为我的 Request 模型对象执行? 可能是什么?
PS 请求 - 这是我的模型(有:title, :description)
发现错误...我有自己的模型请求,我在 RSpec 测试中使用实例变量,如:
@request = Request.create(....
但是RSpec已经使用了这个即时变量:
request
=> #<ActionController::TestRequest:0x007fa8d3b54fb8
@controller_class=RequestsController,
@custom_param_parsers=
这个问题与用我的数据重写必要的RSpec@request
有关