Ruby on rails RSpec-设置request.referer的正确语法
我的测试文件中有:Ruby on rails RSpec-设置request.referer的正确语法,ruby-on-rails,rspec,Ruby On Rails,Rspec,我的测试文件中有: controller.request.stub referer: 'bla' 这将产生弃用警告: Using `stub` from rspec-mocks' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` instead. 控制器规格中设置reques
controller.request.stub referer: 'bla'
这将产生弃用警告:
Using `stub` from rspec-mocks' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` instead.
控制器规格中设置request.referer的正确方法是什么?提前感谢。尝试允许(controller.request)。接收(:referer)。并返回('bla')
正如警告所说,.stub
语法已被弃用