From c0a1a86693db474fa65ddba0fa34558f2ce5ab90 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 12 Feb 2012 03:09:03 -0200 Subject: [PATCH] Cleaning Route generation tests --- actionpack/test/controller/routing_test.rb | 30 ------------------- .../test/lib/controller/fake_controllers.rb | 30 ++----------------- 2 files changed, 2 insertions(+), 58 deletions(-) diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 44a40e0665..d403494261 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -242,36 +242,6 @@ class LegacyRouteSetTests < ActiveSupport::TestCase test_default_setup end - def test_time_recognition - # We create many routes to make situation more realistic - @rs = ::ActionDispatch::Routing::RouteSet.new - @rs.draw { - root :to => "search#new", :as => "frontpage" - resources :videos do - resources :comments - resource :file, :controller => 'video_file' - resource :share, :controller => 'video_shares' - resource :abuse, :controller => 'video_abuses' - end - resources :abuses, :controller => 'video_abuses' - resources :video_uploads - resources :video_visits - - resources :users do - resource :settings - resources :videos - end - resources :channels do - resources :videos, :controller => 'channel_videos' - end - resource :session - resource :lost_password - match 'search' => 'search#index', :as => 'search' - resources :pages - match ':controller/:action/:id' - } - end - def test_route_with_colon_first rs.draw do match '/:controller/:action/:id', :action => 'index', :id => nil diff --git a/actionpack/test/lib/controller/fake_controllers.rb b/actionpack/test/lib/controller/fake_controllers.rb index 09692f77b5..a5364bb01c 100644 --- a/actionpack/test/lib/controller/fake_controllers.rb +++ b/actionpack/test/lib/controller/fake_controllers.rb @@ -1,11 +1,7 @@ -class << Object; alias_method :const_available?, :const_defined?; end - class ContentController < ActionController::Base; end module Admin - class << self; alias_method :const_available?, :const_defined?; end class AccountsController < ActionController::Base; end - class NewsFeedController < ActionController::Base; end class PostsController < ActionController::Base; end class StuffController < ActionController::Base; end class UserController < ActionController::Base; end @@ -17,7 +13,6 @@ module Api class ProductsController < ActionController::Base; end end -# TODO: Reduce the number of test controllers we use class AccountController < ActionController::Base; end class AddressesController < ActionController::Base; end class ArchiveController < ActionController::Base; end @@ -25,38 +20,17 @@ class ArticlesController < ActionController::Base; end class BarController < ActionController::Base; end class BlogController < ActionController::Base; end class BooksController < ActionController::Base; end -class BraveController < ActionController::Base; end class CarsController < ActionController::Base; end class CcController < ActionController::Base; end class CController < ActionController::Base; end -class ElsewhereController < ActionController::Base; end class FooController < ActionController::Base; end class GeocodeController < ActionController::Base; end -class HiController < ActionController::Base; end -class ImageController < ActionController::Base; end class NewsController < ActionController::Base; end class NotesController < ActionController::Base; end +class PagesController < ActionController::Base; end class PeopleController < ActionController::Base; end class PostsController < ActionController::Base; end -class SessionsController < ActionController::Base; end -class StuffController < ActionController::Base; end class SubpathBooksController < ActionController::Base; end class SymbolsController < ActionController::Base; end class UserController < ActionController::Base; end -class WeblogController < ActionController::Base; end - -# For speed test -class SpeedController < ActionController::Base; end -class SearchController < SpeedController; end -class VideosController < SpeedController; end -class VideoFileController < SpeedController; end -class VideoSharesController < SpeedController; end -class VideoAbusesController < SpeedController; end -class VideoUploadsController < SpeedController; end -class VideoVisitsController < SpeedController; end -class UsersController < SpeedController; end -class SettingsController < SpeedController; end -class ChannelsController < SpeedController; end -class ChannelVideosController < SpeedController; end -class LostPasswordsController < SpeedController; end -class PagesController < SpeedController; end +class UsersController < ActionController::Base; end