开发者

Rails 3.1 Engine plugin rspec testing (external gem Spree Commerce)

I created an engine inside an app that depends on an external gem: Spree. And I did my best to set RSpec within that engine following this guide.

When I try testing a controller with some integrated testing: tests_sp开发者_高级运维ec.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

I get an error in the dummy app's environment.rb file, that says that following command couldn't be run:

# Initialize the rails application
Dummy::Application.initialize!

Because my controller is using Admin::ResourceController as an extension which is declared within the external Spree gem. As if rspec is unable to read that class from gemfile of the main app (the one that contains the engine plugin).

Can someone please shed some light on that?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜