diff options
author | Martin Schürrer <martin@schuerrer.org> | 2010-02-21 17:21:25 +0100 |
---|---|---|
committer | Yehuda Katz <yehudakatz@YK.local> | 2010-02-21 13:43:51 -0800 |
commit | 6bc24d40d56332593bc22612d4618a2f80b1d91b (patch) | |
tree | e49938db28fe51f5c45efde3dec5793e65694da0 /actionpack/test | |
parent | 4cdfe98d925397a613c9220bca65be5081c92f56 (diff) | |
download | rails-6bc24d40d56332593bc22612d4618a2f80b1d91b.tar.gz rails-6bc24d40d56332593bc22612d4618a2f80b1d91b.tar.bz2 rails-6bc24d40d56332593bc22612d4618a2f80b1d91b.zip |
Use ActionDispatch::Routing everywhere
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 18 | ||||
-rw-r--r-- | actionpack/test/activerecord/polymorphic_routes_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/controller/rescue_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/resources_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/test_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/controller/webservice_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 10 |
7 files changed, 26 insertions, 26 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 655a133c96..7b41db3fea 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -76,7 +76,7 @@ class ActiveSupport::TestCase # Hold off drawing routes until all the possible controller classes # have been loaded. setup_once do - ActionController::Routing::Routes.draw do |map| + ActionDispatch::Routing::Routes.draw do |map| match ':controller(/:action(/:id))' end end @@ -92,7 +92,7 @@ class ActionController::IntegrationTest < ActiveSupport::TestCase middleware.use "ActionDispatch::Cookies" middleware.use "ActionDispatch::Flash" middleware.use "ActionDispatch::Head" - }.build(routes || ActionController::Routing::Routes) + }.build(routes || ActionDispatch::Routing::Routes) end self.app = build_app @@ -118,19 +118,19 @@ class ActionController::IntegrationTest < ActiveSupport::TestCase end def with_routing(&block) - real_routes = ActionController::Routing::Routes - ActionController::Routing.module_eval { remove_const :Routes } + real_routes = ActionDispatch::Routing::Routes + ActionDispatch::Routing.module_eval { remove_const :Routes } - temporary_routes = ActionController::Routing::RouteSet.new + temporary_routes = ActionDispatch::Routing::RouteSet.new self.class.app = self.class.build_app(temporary_routes) - ActionController::Routing.module_eval { const_set :Routes, temporary_routes } + ActionDispatch::Routing.module_eval { const_set :Routes, temporary_routes } yield temporary_routes ensure - if ActionController::Routing.const_defined? :Routes - ActionController::Routing.module_eval { remove_const :Routes } + if ActionDispatch::Routing.const_defined? :Routes + ActionDispatch::Routing.module_eval { remove_const :Routes } end - ActionController::Routing.const_set(:Routes, real_routes) if real_routes + ActionDispatch::Routing.const_set(:Routes, real_routes) if real_routes self.class.app = self.class.build_app end end diff --git a/actionpack/test/activerecord/polymorphic_routes_test.rb b/actionpack/test/activerecord/polymorphic_routes_test.rb index ea82758cf5..7be2ef7e29 100644 --- a/actionpack/test/activerecord/polymorphic_routes_test.rb +++ b/actionpack/test/activerecord/polymorphic_routes_test.rb @@ -400,7 +400,7 @@ class PolymorphicRoutesTest < ActionController::TestCase map.resources :series end - ActionController::Routing::Routes.install_helpers(self.class) + ActionDispatch::Routing::Routes.install_helpers(self.class) yield end end @@ -422,7 +422,7 @@ class PolymorphicRoutesTest < ActionController::TestCase end end - ActionController::Routing::Routes.install_helpers(self.class) + ActionDispatch::Routing::Routes.install_helpers(self.class) yield end end @@ -441,7 +441,7 @@ class PolymorphicRoutesTest < ActionController::TestCase end end - ActionController::Routing::Routes.install_helpers(self.class) + ActionDispatch::Routing::Routes.install_helpers(self.class) yield end end diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index 37367eaafc..118b563a72 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -326,7 +326,7 @@ class RescueTest < ActionController::IntegrationTest end test 'rescue routing exceptions' do - @app = ActionDispatch::Rescue.new(ActionController::Routing::Routes) do + @app = ActionDispatch::Rescue.new(ActionDispatch::Routing::Routes) do rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, ["Gotcha!"]] } end @@ -335,7 +335,7 @@ class RescueTest < ActionController::IntegrationTest end test 'unrescued exception' do - @app = ActionDispatch::Rescue.new(ActionController::Routing::Routes) + @app = ActionDispatch::Rescue.new(ActionDispatch::Routing::Routes) assert_raise(ActionController::RoutingError) { get '/b00m' } end diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 01ed491732..9b3f466e44 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -394,7 +394,7 @@ class ResourcesTest < ActionController::TestCase assert_restful_routes_for :messages do |options| assert_recognizes(options.merge(:action => "new"), :path => "/messages/new", :method => :get) assert_raise(ActionController::RoutingError) do - ActionController::Routing::Routes.recognize_path("/messages/new", :method => :post) + ActionDispatch::Routing::Routes.recognize_path("/messages/new", :method => :post) end end end @@ -504,7 +504,7 @@ class ResourcesTest < ActionController::TestCase def test_restful_routes_dont_generate_duplicates with_restful_routing :messages do - routes = ActionController::Routing::Routes.routes + routes = ActionDispatch::Routing::Routes.routes routes.each do |route| routes.each do |r| next if route === r # skip the comparison instance diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 0f074b32e6..3f5d60540f 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -476,8 +476,8 @@ XML end def test_with_routing_places_routes_back - assert ActionController::Routing::Routes - routes_id = ActionController::Routing::Routes.object_id + assert ActionDispatch::Routing::Routes + routes_id = ActionDispatch::Routing::Routes.object_id begin with_routing { raise 'fail' } @@ -485,8 +485,8 @@ XML rescue RuntimeError end - assert ActionController::Routing::Routes - assert_equal routes_id, ActionController::Routing::Routes.object_id + assert ActionDispatch::Routing::Routes + assert_equal routes_id, ActionDispatch::Routing::Routes.object_id end def test_remote_addr diff --git a/actionpack/test/controller/webservice_test.rb b/actionpack/test/controller/webservice_test.rb index 5882a8cfa3..ede48017cf 100644 --- a/actionpack/test/controller/webservice_test.rb +++ b/actionpack/test/controller/webservice_test.rb @@ -245,7 +245,7 @@ class WebServiceTest < ActionController::IntegrationTest private def with_params_parsers(parsers = {}) old_session = @integration_session - @app = ActionDispatch::ParamsParser.new(ActionController::Routing::Routes, parsers) + @app = ActionDispatch::ParamsParser.new(ActionDispatch::Routing::Routes, parsers) reset! yield ensure diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 0cd1fddff1..e29127f78f 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -728,14 +728,14 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest private def with_test_routes - real_routes, temp_routes = ActionController::Routing::Routes, Routes + real_routes, temp_routes = ActionDispatch::Routing::Routes, Routes - ActionController::Routing.module_eval { remove_const :Routes } - ActionController::Routing.module_eval { const_set :Routes, temp_routes } + ActionDispatch::Routing.module_eval { remove_const :Routes } + ActionDispatch::Routing.module_eval { const_set :Routes, temp_routes } yield ensure - ActionController::Routing.module_eval { remove_const :Routes } - ActionController::Routing.const_set(:Routes, real_routes) + ActionDispatch::Routing.module_eval { remove_const :Routes } + ActionDispatch::Routing.const_set(:Routes, real_routes) end end |