From 926f4648f0628009336c44f4d31019819434e39c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 1 May 2008 17:26:31 -0500 Subject: Made the location of the routes file configurable with config.routes_configuration_file (Scott Fleckenstein) [#88 state:resolved] --- actionpack/test/controller/routing_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/controller/routing_test.rb') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 5756c05e2e..640afd58f8 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -2341,11 +2341,13 @@ uses_mocha 'route loading' do def setup routes.instance_variable_set '@routes_last_modified', nil silence_warnings { Object.const_set :RAILS_ROOT, '.' } + ActionController::Routing::Routes.configuration_file = File.join(RAILS_ROOT, 'config', 'routes.rb') @stat = stub_everything end def teardown + ActionController::Routing::Routes.configuration_file = nil Object.send :remove_const, :RAILS_ROOT end @@ -2386,6 +2388,14 @@ uses_mocha 'route loading' do Inflector.inflections { |inflect| inflect.uncountable('equipment') } end + + def test_load_with_configuration + routes.configuration_file = "foobarbaz" + File.expects(:stat).returns(@stat) + routes.expects(:load).with("foobarbaz") + + routes.reload + end private def routes -- cgit v1.2.3