Skip to content

Testing Engine Assets

jejacks0n edited this page Dec 7, 2012 · 9 revisions

It's a common technique to have a dummy application within your engine test suite, and Teabag makes it really easy to get setup in that way.

Change the configuration to specify where the root of where your specs live. You can do this in an initializer in the dummy application, which you can get by running the rails g teabag:install generator from within the dummy app.

config/initializers/teabag.rb

Teabag.setup do |config|
  config.root = Your::Engine.root
end

And it's common that you'd want the rake tasks from the root of your engine as well. You can add the rake tasks to your own RakeFile:

load 'teabag/tasks/teabag.rake'