Yar*_*veh 1 ruby ruby-on-rails
我运行这个单元测试:
require 'test_helper'
class MyControllerTest < ActionController::TestCase
test "my action works" do
get(:my_action, {'url' => "http://localhost:8090/"})
end
end
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
NoMethodError: undefined method 'request=' for #<MyController:0x5150896>
Run Code Online (Sandbox Code Playgroud)
任何的想法?
编辑此操作只有POST而不是GET但是当我在单元测试中更改为post时,我看到相同的resutls