【发布时间】:2016-11-16 13:57:15
【问题描述】:
我的routes.rb 中有post '/foo/bar', to: 'api/v1/things#bar'。
运行rails routes 返回
foo_bar POST /foo/bar(.:format) api/v1/things#bar
我正在尝试使用post '/foo/bar' 对其进行测试,但我得到了
No route matches {:action=>"/foo/bar", :controller=>"api/v1/things"}
我知道这个问题很愚蠢,但我看不到它。有什么想法吗?
【问题讨论】:
-
这是哪种测试?控制器测试?
-
是的,控制器测试。
标签: ruby-on-rails ruby rspec ruby-on-rails-5