0
컬
작동하지 :레일 사용자 정의 경로 때 테스트를 찾았지만, 설정/routes.rb에서
match 'app_config/:version' => "application#appconfig"
시험/기능/application_controller_test.rb :
require 'test_helper'
class ApplicationControllerTest < ActionController::TestCase
test "app config" do
get "/app_config/v2"
assert_response :success
end
end
rake test
:
1) Error:
test_app_config(ApplicationControllerTest):
ActionController::RoutingError: No route matches {:controller=>"application", :action=>"/app_config/v2"}
하지만 $ curl localhost:3000/app_config/v2
이 작동하고 예상 한 응답을 반환하며 rake routes
은 r 예상과 다르게 어떤 일이 벌어지고 있는지, 또 어떻게 조사 할 생각인가? 이것은 기본적으로 프로젝트의 유일한 코드입니다.
고마워요! 나는'get '이 생성 된 성능 테스트에서'get /''때문에 경로를 취할 수 있다고 생각했다. – Narfanator