From ca7207838844f02f50afbb18beb0f535903f7929 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 22 May 2009 16:11:54 -0700 Subject: Move fake controllers and models to a common load path --- actionpack/test/controller/fake_controllers.rb | 33 ---------------------- actionpack/test/controller/fake_models.rb | 19 ------------- actionpack/test/controller/layout_test.rb | 2 +- actionpack/test/lib/controller/fake_controllers.rb | 33 ++++++++++++++++++++++ actionpack/test/lib/controller/fake_models.rb | 19 +++++++++++++ 5 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 actionpack/test/controller/fake_controllers.rb delete mode 100644 actionpack/test/controller/fake_models.rb create mode 100644 actionpack/test/lib/controller/fake_controllers.rb create mode 100644 actionpack/test/lib/controller/fake_models.rb (limited to 'actionpack/test') diff --git a/actionpack/test/controller/fake_controllers.rb b/actionpack/test/controller/fake_controllers.rb deleted file mode 100644 index 75c114c103..0000000000 --- a/actionpack/test/controller/fake_controllers.rb +++ /dev/null @@ -1,33 +0,0 @@ -class << Object; alias_method :const_available?, :const_defined?; end - -class ContentController < Class.new(ActionController::Base) -end -class NotAController -end -module Admin - class << self; alias_method :const_available?, :const_defined?; end - class UserController < Class.new(ActionController::Base); end - class NewsFeedController < Class.new(ActionController::Base); end -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 SessionsController < SpeedController; end -class LostPasswordsController < SpeedController; end -class PagesController < SpeedController; end - -ActionController::Routing::Routes.draw do |map| - map.route_one 'route_one', :controller => 'elsewhere', :action => 'flash_me' - map.connect ':controller/:action/:id' -end diff --git a/actionpack/test/controller/fake_models.rb b/actionpack/test/controller/fake_models.rb deleted file mode 100644 index 0b30c79b10..0000000000 --- a/actionpack/test/controller/fake_models.rb +++ /dev/null @@ -1,19 +0,0 @@ -class Customer < Struct.new(:name, :id) - def to_param - id.to_s - end -end - -class BadCustomer < Customer -end - -class GoodCustomer < Customer -end - -module Quiz - class Question < Struct.new(:name, :id) - def to_param - id.to_s - end - end -end diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb index 04da0a7f86..cb9bdf57bb 100644 --- a/actionpack/test/controller/layout_test.rb +++ b/actionpack/test/controller/layout_test.rb @@ -9,7 +9,7 @@ ActionView::Template::register_template_handler :mab, ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../fixtures/layout_tests/' ] -require "lib/fixture_template" +require "fixture_template" class LayoutTest < ActionController::Base def self.controller_path; 'views' end diff --git a/actionpack/test/lib/controller/fake_controllers.rb b/actionpack/test/lib/controller/fake_controllers.rb new file mode 100644 index 0000000000..75c114c103 --- /dev/null +++ b/actionpack/test/lib/controller/fake_controllers.rb @@ -0,0 +1,33 @@ +class << Object; alias_method :const_available?, :const_defined?; end + +class ContentController < Class.new(ActionController::Base) +end +class NotAController +end +module Admin + class << self; alias_method :const_available?, :const_defined?; end + class UserController < Class.new(ActionController::Base); end + class NewsFeedController < Class.new(ActionController::Base); end +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 SessionsController < SpeedController; end +class LostPasswordsController < SpeedController; end +class PagesController < SpeedController; end + +ActionController::Routing::Routes.draw do |map| + map.route_one 'route_one', :controller => 'elsewhere', :action => 'flash_me' + map.connect ':controller/:action/:id' +end diff --git a/actionpack/test/lib/controller/fake_models.rb b/actionpack/test/lib/controller/fake_models.rb new file mode 100644 index 0000000000..0b30c79b10 --- /dev/null +++ b/actionpack/test/lib/controller/fake_models.rb @@ -0,0 +1,19 @@ +class Customer < Struct.new(:name, :id) + def to_param + id.to_s + end +end + +class BadCustomer < Customer +end + +class GoodCustomer < Customer +end + +module Quiz + class Question < Struct.new(:name, :id) + def to_param + id.to_s + end + end +end -- cgit v1.2.3