4
我有一个失败的测试,我很难理解。我在应用程序/控制器/用户/ queries_controller.rb控制器class Users::QueriesController < ApplicationController
具有show
作用,并有相应的命名空间路线:Rails 4:在名称空间控制器上测试GET请求
namespace :users do
resources :queries
end
我也有在测试/控制器/用户/ queries_controller_test.rb测试:
require 'test_helper'
class Users::QueriesControllerTest < ActionController::TestCase
test "accessing :show action" do
get :show
assert_response :success
end
end
运行此测试结果ActionController::UrlGenerationError: No route matches {:controller=>"users/queries", :action=>"show"}
。
正在运行rake routes
包含此行:users_query GET /users/queries/:id(.:format) users/queries#show
。
这里怎么回事?我正在使用Rails 4.0.0。
啊!这样一个简单的错误。猜猜是其中之一。谢谢! – 6twenty