I apologize if this question is slightly subjective... I am trying to figure out the best way to test Rails 3 Engines with Cucumber & Rspec. In order to test the engine a r
Rails 3.1 (will) generate a pretty good scaffold for engines. I'd recommend using RVM to create a new gemset called edge and switch to it:
rvm gemset create edge
rvm use @edge
Then install edge rails:
git clone git://github.com/rails/rails.git
cd rails
rake install
From there, you can follow Piotr Sarnacki's mountable app tutorial, replacing calls such as:
bundle exec ./bin/rails plugin new ../blog --edge --mountable
With simply:
rails plugin new blog --mountable --full
The mountable option makes the application mountable, whilst the full option makes it an engine with tests already built-in. To test the engine, this generator generates a folder in test
called dummy
which contains a small Rails application. You can see how this is loaded in test/test_helper.rb
.
Then it's up to you to massage the data to do what it needs to in order to work. I would recommend copying over the cucumber files from a standard rails g cucumber:install
into the project and then messing about with it until it works. I've done this once before so I know it's possible, but I cannot find the code right now.
Let me know how you go.