给定路由:
scope :path => 'shipping_reports', :controller => 'ShippingReports', :as => 'shipping_reports' do
get 'index'
end以及以下测试:
class ShippingReportsControllerTest < ActionController::TestCase
test "routing" do
assert_routing '/shipping_reports/index', { :controller => "ShippingReports", :action => "index" }
end
test 'index' do
get :index
assert_response :success
end
end第一个测试通过,第二个测试失败,如下所示:
ActionController::RoutingError: No route matches {:controller=>"shipping_reports"}有谁知道我怎么才能通过测试?
https://stackoverflow.com/questions/13601089
复制相似问题