Skip to content

Instantly share code, notes, and snippets.

@dajulia3
Last active August 29, 2015 14:02
Show Gist options
  • Save dajulia3/8bb620f3a768c1aa18e4 to your computer and use it in GitHub Desktop.
Save dajulia3/8bb620f3a768c1aa18e4 to your computer and use it in GitHub Desktop.
use_route without monkey patching for engine controller tests
#......
#A bunch of spec_helper code....
Rspec.configure do |config|
module UseRoutesForControllerTests
def self.included(base)
base.class_eval do
routes { MyEngine::Engine.routes }
end
end
end
config.include UseRoutesForControllerTests, type: :controller
end
#...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment