Run this command, replace gem_name
$ rails plugin new gem_name -T --mountable --dummy-path=spec/dummy # for namespaced mountable engine
$ rails plugin new gem_name -T --full --dummy-path=spec/dummy # for basic engine
Add the following to the Gemfile
gem "rspec-rails", "2.14.0.rc1"
gem "factory_girl_rails", "4.2.1"
Bundle locally
$ bundle install --path vendor
Add the following to lib/gem_name/engine.rb
config.generators do |g|
g.test_framework :rspec
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
end
Run the following to setup RSpec
$ bundle exec rails generate rspec:install
Run the following from within spec/dummy
to run the dummy app, using the engine
$ rails s