From a278f2331007411b190d65577082d2710ad9a996 Mon Sep 17 00:00:00 2001
From: Carlhuda <carlhuda@engineyard.com>
Date: Wed, 24 Feb 2010 16:17:04 -0800
Subject: Fix all of AP's tests with the non global router

---
 actionpack/test/activerecord/polymorphic_routes_test.rb | 6 +++---
 actionpack/test/controller/caching_test.rb              | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/actionpack/test/activerecord/polymorphic_routes_test.rb b/actionpack/test/activerecord/polymorphic_routes_test.rb
index 7be2ef7e29..a10bb4473e 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
 
-      ActionDispatch::Routing::Routes.install_helpers(self.class)
+      self.class.send(:include, @router.named_url_helpers)
       yield
     end
   end
@@ -422,7 +422,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
         end
       end
 
-      ActionDispatch::Routing::Routes.install_helpers(self.class)
+      self.class.send(:include, @router.named_url_helpers)
       yield
     end
   end
@@ -441,7 +441,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
         end
       end
 
-      ActionDispatch::Routing::Routes.install_helpers(self.class)
+      self.class.send(:include, @router.named_url_helpers)
       yield
     end
   end
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index de92fc56fd..9c9d886f5d 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -74,9 +74,9 @@ class PageCachingTest < ActionController::TestCase
         match '/', :to => 'posts#index', :as => :main
       end
       @params[:format] = 'rss'
-      assert_equal '/posts.rss', @rewriter.rewrite(@params)
+      assert_equal '/posts.rss', @rewriter.rewrite(@router, @params)
       @params[:format] = nil
-      assert_equal '/', @rewriter.rewrite(@params)
+      assert_equal '/', @rewriter.rewrite(@router, @params)
     end
   end
 
@@ -511,6 +511,8 @@ class ActionCacheTest < ActionController::TestCase
       @request    = ActionController::TestRequest.new
       @response   = ActionController::TestResponse.new
       @controller = ActionCachingTestController.new
+      # ROUTES TODO: It seems bad to explicitly remix in the class
+      @controller.metaclass.send(:include, @router.named_url_helpers)
       @request.host = 'hostname.com'
     end
 
-- 
cgit v1.2.3