外部の gem: Spree に依存するアプリ内にエンジンを作成しました。そして、このガイドに従って、そのエンジン内に RSpec を設定するために最善を尽くしました。
いくつかの統合テストでコントローラーをテストしようとすると: tests_spec.rb:
require 'spec_helper'
describe "Tests" do
describe "GET /tests" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get tests_path
response.status.should be(200)
end
end
end
ダミー アプリの environment.rb ファイルに、次のコマンドを実行できないというエラーが表示されます。
# Initialize the rails application
Dummy::Application.initialize!
私のコントローラーは Admin::ResourceController を拡張機能として使用しているため、外部 Spree gem 内で宣言されています。rspec がメイン アプリ (エンジン プラグインを含むもの) の gemfile からそのクラスを読み取ることができないかのように。
誰かがそれに光を当てることができますか?