1
내 프로그램의 모든 경로를 수동으로 만들고 내 rspec 테스트와 마찬가지로합니다. 일반적으로 내 경로 및 테스트는 정상적으로 작동하지만 내 문자 컨트롤러의 테스트에 문제가 있습니다. 경로는 다음과 같습니다.Rails Rspec 테스트가 작동하지 않는 이유는 무엇입니까?
scope :path => '/characters', :controller => :characters do
get '/' => :show, :as => 'user_character'
end
브라우저에서 테스트 할 때/문자가 올바르게 작동합니다. 모든게 잘된 것 같습니다. 그러나, 시험 :
require 'spec_helper'
require 'devise/test_helpers'
describe CharactersController do
login_user
describe "when it GETS 'show'" do
it "should render the template and be successful" do
get :show
response.should render_template(:show)
response.should be_success
end
end
end
오류와 함께 실패합니다
1) CharactersController when it GETS 'show' should render the template and be successful
Failure/Error: get :show
ActionController::RoutingError:
No route matches {:controller=>"characters", :action=>"show"}
# ./spec/controllers/characters_controller_spec.rb:9
내 모든 컨트롤러는 잘 작동 비슷한 테스트가 있습니다. 왜 이것이 작동하지 않습니까?
중요 편집 :
그냥 내가 오프 Spork 설정 한 경우, 테스트를 통과 한 것을보고! 왜 이런 일이 일어나는 걸까요? 새 테스트가 추가 될 때마다 Spork를 다시 시작해야합니까?