레일 4 베타 1 애플리케이션에 여러 개의 레일스 엔진이 있습니다. 모든 엔진에 rspec-rails
보석을 설치했습니다. 그리고 내 엔진 다음 명령을 만들었습니다 :다중 레일 엔진 rspec 컨트롤러 테스트가 작동하지 않습니다.
rails plugin new store_frontend --dummy-path=spec/dummy -d postgresql --skip-test-unit --mountable
내 엔진의 더미 응용 프로그램에서 데이터베이스와 경로를 구성했습니다.
1) StoreAdmin::DashboardController GET 'index' returns http success
Failure/Error: get 'index'
ActionController::UrlGenerationError:
No route matches {:action=>"index", :controller=>"store_admin/dashboard"}
# ./spec/controllers/store_admin/dashboard_controller_spec.rb:8:in `block (3 levels) in <module:StoreAdmin>'
그리고 여기에/그것은/레일에서 내 컨트롤러 테스트 생성 된 것입니다 :
내가 먼저 엔진 내부 RSpec에 실행하면Rails.application.routes.draw do
mount StoreFrontend::Engine => "/store"
end
나는 다음과 같은 오류를 얻을 : 다음 예제 routes.rb 파일입니다
require 'spec_helper'
module StoreFrontend
describe HomeController do
describe "GET 'index'" do
it "returns http success" do
get 'index'
response.should be_success
end
end
end
end
컨트롤러 테스트가 작동하지 않는 것 같습니다. 모델 테스트가 있는데 잘 작동합니다. 어떤 생각?
UPDATE 1 : 내 응용 프로그램 구조 :
bin/
config/
db/
lib/
log/
public/
tmp/
engine1/
engine2/
engine3/
은 사양 표시 및 사양 결과는 동일한 코드 관련이없는 – apneadiving