-
Notifications
You must be signed in to change notification settings - Fork 22k
Description
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/5922
Created by Andrea Campi - 2011-04-09 22:41:49 UTC
I may be overlooking something, but:
I have a functional test that uses its own mock controller, which prepares some data and ends up calling a helper.
Among other things, I want to test that this helper generates the correct URLs, so I need my routes from config/routes.rb.
To be able to invoke actions on my mock controller, I have:
setup do Rails.application.routes.draw do match '/foo' => "tags_tree_test/tags_tree_test#index" end end teardown do Rails.application.reload_routes! end
The problem is that #draw first clears existing routes.
Of course this would just work if I used an existing controller for which I already have a route in config/routes.rb--but I want to run this test in a clean environment.
Am I correct that there's no way to do this?
Do we want to support this use case?