我的Rails 4 beta1应用程序中有多个Rails引擎。我为每个引擎安装了rspec-rails
宝石。我建立了我的引擎以下命令:多个Rails引擎rspec控制器测试不起作用
rails plugin new store_frontend --dummy-path=spec/dummy -d postgresql --skip-test-unit --mountable
在我的引擎的虚拟应用程序,我配置的数据库和路线。下面是例子的routes.rb文件:
Rails.application.routes.draw do
mount StoreFrontend::Engine => "/store"
end
当我第一次发动机内部rspec的运行,我得到以下错误:
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>'
,这里是我的控制器测试/它是从轨道/生成:
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
看起来控制器测试不起作用。我有模型测试,它工作正常。任何想法?
更新1: 我的应用程序结构:
bin/
config/
db/
lib/
log/
public/
tmp/
engine1/
engine2/
engine3/
规范展示和规范的结果不涉及相同的代码 – apneadiving 2013-04-26 08:15:21