From 350d3daa8825ac2049a306506b14193f0896e8ff Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Mon, 23 Nov 2009 19:25:39 -0600
Subject: Remove inflection reloads routes test

---
 actionpack/test/controller/routing_test.rb | 7 -------
 1 file changed, 7 deletions(-)

(limited to 'actionpack/test')

diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 4eaf309c41..a2fdbfbbbe 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -1762,13 +1762,6 @@ class RouteLoadingTest < Test::Unit::TestCase
     2.times { routes.reload! }
   end
 
-  def test_adding_inflections_forces_reload
-    ActiveSupport::Inflector::Inflections.instance.expects(:uncountable).with('equipment')
-    routes.expects(:reload!)
-
-    ActiveSupport::Inflector.inflections { |inflect| inflect.uncountable('equipment') }
-  end
-
   def test_load_with_configuration
     routes.configuration_files.clear
     routes.add_configuration_file("foobarbaz")
-- 
cgit v1.2.3


From 15ab3a98a1b6f9b829060ba974048b33466f6814 Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Mon, 23 Nov 2009 20:20:50 -0600
Subject: Find all controllers in memory to use for routing

---
 actionpack/test/abstract_unit.rb | 12 ------------
 1 file changed, 12 deletions(-)

(limited to 'actionpack/test')

diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 775cfc82bf..9d055da4b9 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -191,20 +191,8 @@ class ::ApplicationController < ActionController::Base
 end
 
 module ActionController
-  module Routing
-    def self.possible_controllers
-      @@possible_controllers ||= []
-    end
-  end
-
   class Base
     include ActionController::Testing
-
-    def self.inherited(klass)
-      name = klass.name.underscore.sub(/_controller$/, '')
-      ActionController::Routing.possible_controllers << name unless name.blank?
-      super
-    end
   end
 
   Base.view_paths = FIXTURE_LOAD_PATH
-- 
cgit v1.2.3


From 59dbae145b939ca733b7fc9ed0205b01c3d6799c Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Mon, 23 Nov 2009 21:50:21 -0600
Subject: Privatize Routing.possible_controllers and fix brittle url helper
 controller test loading.

---
 actionpack/test/controller/routing_test.rb  | 24 ---------------
 actionpack/test/template/url_helper_test.rb | 45 ++++++++++++-----------------
 2 files changed, 19 insertions(+), 50 deletions(-)

(limited to 'actionpack/test')

diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index a2fdbfbbbe..b5effeda40 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -51,30 +51,6 @@ class UriReservedCharactersRoutingTest < Test::Unit::TestCase
   end
 end
 
-class RoutingTest < Test::Unit::TestCase
-  def test_normalize_unix_paths
-    load_paths = %w(. config/../app/controllers config/../app//helpers script/../config/../vendor/rails/actionpack/lib vendor/rails/railties/builtin/rails_info app/models lib script/../config/../foo/bar/../../app/models .foo/../.bar foo.bar/../config)
-    paths = ActionController::Routing.normalize_paths(load_paths)
-    assert_equal %w(vendor/rails/railties/builtin/rails_info vendor/rails/actionpack/lib app/controllers app/helpers app/models config .bar lib .), paths
-  end
-
-  def test_normalize_windows_paths
-    load_paths = %w(. config\\..\\app\\controllers config\\..\\app\\\\helpers script\\..\\config\\..\\vendor\\rails\\actionpack\\lib vendor\\rails\\railties\\builtin\\rails_info app\\models lib script\\..\\config\\..\\foo\\bar\\..\\..\\app\\models .foo\\..\\.bar foo.bar\\..\\config)
-    paths = ActionController::Routing.normalize_paths(load_paths)
-    assert_equal %w(vendor\\rails\\railties\\builtin\\rails_info vendor\\rails\\actionpack\\lib app\\controllers app\\helpers app\\models config .bar lib .), paths
-  end
-
-  def test_routing_helper_module
-    assert_kind_of Module, ActionController::Routing::Helpers
-
-    h = ActionController::Routing::Helpers
-    c = Class.new
-    assert ! c.ancestors.include?(h)
-    ActionController::Routing::Routes.install_helpers c
-    assert c.ancestors.include?(h)
-  end
-end
-
 class MockController
   attr_accessor :routes
 
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index bf0b4ad3a7..5c463a4f60 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -391,54 +391,47 @@ class UrlHelperTest < ActionView::TestCase
     end
 end
 
-class UrlHelperController < ActionController::Base
-  def self.controller_path; 'url_helper_with_controller' end
+class UrlHelperControllerTest < ActionController::TestCase
+  class UrlHelperController < ActionController::Base
+    def show_url_for
+      render :inline => "<%= url_for :controller => 'url_helper_controller_test/url_helper', :action => 'show_url_for' %>"
+    end
 
-  def show_url_for
-    render :inline => "<%= url_for :controller => 'url_helper_with_controller', :action => 'show_url_for' %>"
-  end
+    def show_named_route
+      render :inline => "<%= show_named_route_#{params[:kind]} %>"
+    end
 
-  def show_named_route
-    render :inline => "<%= show_named_route_#{params[:kind]} %>"
-  end
+    def nil_url_for
+      render :inline => '<%= url_for(nil) %>'
+    end
 
-  def nil_url_for
-    render :inline => '<%= url_for(nil) %>'
+    def rescue_action(e) raise e end
   end
 
-  def rescue_action(e) raise e end
-end
-
-class UrlHelperWithControllerTest < ActionController::TestCase
-  def setup
-    super
-    @request    = ActionController::TestRequest.new
-    @response   = ActionController::TestResponse.new
-    @controller = UrlHelperController.new
-  end
+  tests UrlHelperController
 
   def test_url_for_shows_only_path
     get :show_url_for
-    assert_equal '/url_helper_with_controller/show_url_for', @response.body
+    assert_equal '/url_helper_controller_test/url_helper/show_url_for', @response.body
   end
 
   def test_named_route_url_shows_host_and_path
     with_url_helper_routing do
       get :show_named_route, :kind => 'url'
-      assert_equal 'http://test.host/url_helper_with_controller/show_named_route', @response.body
+      assert_equal 'http://test.host/url_helper_controller_test/url_helper/show_named_route', @response.body
     end
   end
 
   def test_named_route_path_shows_only_path
     with_url_helper_routing do
       get :show_named_route, :kind => 'path'
-      assert_equal '/url_helper_with_controller/show_named_route', @response.body
+      assert_equal '/url_helper_controller_test/url_helper/show_named_route', @response.body
     end
   end
 
   def test_url_for_nil_returns_current_path
     get :nil_url_for
-    assert_equal '/url_helper/nil_url_for', @response.body
+    assert_equal '/url_helper_controller_test/url_helper/nil_url_for', @response.body
   end
 
   def test_named_route_should_show_host_and_path_using_controller_default_url_options
@@ -450,7 +443,7 @@ class UrlHelperWithControllerTest < ActionController::TestCase
 
     with_url_helper_routing do
       get :show_named_route, :kind => 'url'
-      assert_equal 'http://testtwo.host/url_helper_with_controller/show_named_route', @response.body
+      assert_equal 'http://testtwo.host/url_helper_controller_test/url_helper/show_named_route', @response.body
     end
   end
 
@@ -458,7 +451,7 @@ class UrlHelperWithControllerTest < ActionController::TestCase
     def with_url_helper_routing
       with_routing do |set|
         set.draw do |map|
-          map.show_named_route 'url_helper_with_controller/show_named_route', :controller => 'url_helper', :action => 'show_named_route'
+          map.show_named_route 'url_helper_controller_test/url_helper/show_named_route', :controller => 'url_helper_controller_test/url_helper', :action => 'show_named_route'
         end
         yield
       end
-- 
cgit v1.2.3