Rails 3.2.x에서 Rails 4.0.4로 응용 프로그램을 이식하려고합니다. 모든 보석은 호환이 가능하며 실패한 테스트를 수정하는 단계에 있습니다.레일 4 업그레이드 - ActionController :: UrlGenerationError - 경로 일치 없음
나는 이상한 시험 실패를 경험했다.
내 routes.rb
resources :my_reports, only: [:index] do
collection do
get "/report/:filename", to: :show, prefix: "pri/excl/rep", as: :show
end
end
가 레일 3.2.x에 전달하고 지금은 다음과 같은 오류
무엇입니까 4.0.4
describe MyReportsController do
describe "#show" do
def make_request
get :show, prefix: 'some/place', filename: 'foo', format: 'doc'
end
it "makes a simple request" do
make_request
end
end
end
로 업데이트 후 실패했습니다
내 사양
Failure/Error: get :show, prefix: 'some/place', filename: 'foo', format: 'doc'
ActionController::UrlGenerationError:
No route matches {:action=>"show", :controller=>"my_reports",
:filename=>"foo", :format=>"doc", :prefix=>"some/place"}
나는이 시점에서 갇혀 있는데, 힌트를 환영합니다. rspec 및 rspec-rails 버전 2.14.1을 사용하고 있습니다.
아니요, 이미 확인했습니다. 리소스에 쇼를 포함 시켰지 만 명시 적으로': as '를 사용했을 때 아무런 영향을주지 않아야합니다 – bragboy
중첩 된 메소드없이'get : show, prefix : ...'를 직접 시도 했습니까? – BriceB