I have written a Rails 3.1 engine with the namespace Posts. Hence, my controllers are found in app/controllers/posts/, my models in app/models/posts, etc. I can test the mod
Based on this answer I chose the following solution:
#spec/spec_helper.rb RSpec.configure do |config| # other code config.before(:each) { @routes = UserManager::Engine.routes } end
The additional benefit is, that you don't need to have the before(:each) block in every controller-spec.
before(:each)