diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-26 21:59:28 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-26 21:59:28 -0500 |
commit | a6757a02e12aa584bd74dbcde18a7886be8e9029 (patch) | |
tree | 74d3ca8fe45d1bc031371e7735241fa265e42c67 /actionpack/test/controller | |
parent | 14866fa3d83676d340d94464f50e2e0ea989c3c1 (diff) | |
download | rails-a6757a02e12aa584bd74dbcde18a7886be8e9029.tar.gz rails-a6757a02e12aa584bd74dbcde18a7886be8e9029.tar.bz2 rails-a6757a02e12aa584bd74dbcde18a7886be8e9029.zip |
Move middleware and route configuration from AC::Dispatcher to Rails application object
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/dispatcher_test.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/actionpack/test/controller/dispatcher_test.rb b/actionpack/test/controller/dispatcher_test.rb index 7ef2564e5a..622d67287d 100644 --- a/actionpack/test/controller/dispatcher_test.rb +++ b/actionpack/test/controller/dispatcher_test.rb @@ -14,14 +14,12 @@ class DispatcherTest < Test::Unit::TestCase ActionDispatch::Callbacks.reset_callbacks(:prepare) ActionDispatch::Callbacks.reset_callbacks(:call) - @old_router, Dispatcher.router = Dispatcher.router, mock() - Dispatcher.router.stubs(:call).returns([200, {}, 'response']) - Dispatcher.router.stubs(:reload) + ActionController::Routing::Routes.stubs(:call).returns([200, {}, 'response']) + ActionController::Routing::Routes.stubs(:reload) Dispatcher.stubs(:require_dependency) end def teardown - Dispatcher.router = @old_router ENV.delete 'REQUEST_METHOD' end @@ -31,12 +29,12 @@ class DispatcherTest < Test::Unit::TestCase end def test_reloads_routes_before_dispatch_if_in_loading_mode - Dispatcher.router.expects(:reload).once + ActionController::Routing::Routes.expects(:reload).once dispatch(false) end def test_leaves_dependencies_after_dispatch_if_not_in_loading_mode - Dispatcher.router.expects(:reload).never + ActionController::Routing::Routes.expects(:reload).never ActiveSupport::Dependencies.expects(:clear).never dispatch @@ -78,7 +76,7 @@ class DispatcherTest < Test::Unit::TestCase ActionController::Dispatcher.prepare_each_request = false Dispatcher.define_dispatcher_callbacks(cache_classes) - @dispatcher ||= ActionDispatch::Callbacks.new(Dispatcher.router) + @dispatcher ||= ActionDispatch::Callbacks.new(ActionController::Routing::Routes) @dispatcher.call({'rack.input' => StringIO.new(''), 'action_dispatch.show_exceptions' => false}) end |