0
我有安裝發動機在routes.rb中,像這樣的應用程序:RSpec的測試主應用程序無法找到安裝的發動機
mount Quby::Engine => "/quby", :as => "quby_engine"
它有一個控制器動作,做這個:
def collect_answers
# do a bunch of stuff and then
redirect_to quby_engine.edit_questionnaire_answers_path(questionnaire)
end
這樣確實可以在瀏覽器中,但是對於我的行動RSpec的控制器測試:
it 'should redirect to something' do
get :collect_answers, :key => "honos"
response.should redirect_to("something")
end
失敗,出現消息:
Failure/Error: get :collect_answers, :key => "honos"
undefined local variable or method `quby_engine' for #<EvaluateController:0x00000007245c50>
我是否需要做一些特殊的事情才能讓引擎安裝在我的控制器測試中?
編輯:沒關係,我想我有一個Spork服務器正在運行,但沒有重新載入新的安裝的應用程序。