我喜欢在我的 rails 应用程序中将 ruby 版本从 升级2.4.2
到。2.5.0
在我使用 turbolink 的地方,所有规格/测试都失败了。turbolinks 和 ruby 是否存在已知问题2.5.0
?
这是终端上的输出。
Failure/Error: expect(request).to redirect_to company_salesmen_path(salesman.company)
NoMethodError:
undefined method `get?' for 302:Integer
# /Users/dennish/.rvm/gems/ruby-2.5.0/gems/turbolinks-5.1.0/lib/turbolinks/assertions.rb:37:in `turbolinks_request?'
# /Users/dennish/.rvm/gems/ruby-2.5.0/gems/turbolinks-5.1.0/lib/turbolinks/assertions.rb:6:in `assert_redirected_to'
# ./spec/requests/salesmen_spec.rb:206:in `block (3 levels) in <top (required)>'
这是规格:
describe 'DELETE /salesman/:id' do
subject(:request) do
delete salesman_path(salesman), headers: auth_headers
end
let!(:salesman) { create :salesman }
it 'destroys salesman' do
expect { request }.to change { Salesman.count }.by(-1)
end
it 'redirects to index' do
expect(request).to redirect_to company_salesmen_path(salesman.company)
end
end