aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-05-01 17:26:31 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-05-01 17:26:31 -0500
commit926f4648f0628009336c44f4d31019819434e39c (patch)
tree41832ea22ba2c567cca2cad41db1cb966be090ae /actionpack/test/controller/routing_test.rb
parente931394d098714c6a4cbb91b8c8c00bd9d6fb850 (diff)
downloadrails-926f4648f0628009336c44f4d31019819434e39c.tar.gz
rails-926f4648f0628009336c44f4d31019819434e39c.tar.bz2
rails-926f4648f0628009336c44f4d31019819434e39c.zip
Made the location of the routes file configurable with config.routes_configuration_file (Scott Fleckenstein) [#88 state:resolved]
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb10
1 files changed, 10 insertions, 0 deletions
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