diff options
Diffstat (limited to 'actionpack/test/new_base')
-rw-r--r-- | actionpack/test/new_base/test_helper.rb | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb index 9271b2dd59..b7ccd3db8d 100644 --- a/actionpack/test/new_base/test_helper.rb +++ b/actionpack/test/new_base/test_helper.rb @@ -35,12 +35,6 @@ class Rack::TestCase < ActionController::IntegrationTest setup do ActionController::Base.session_options[:key] = "abc" ActionController::Base.session_options[:secret] = ("*" * 30) - - controllers = ActionController::Base.subclasses.map do |k| - k.underscore.sub(/_controller$/, '') - end - - ActionController::Routing.use_controllers!(controllers) end def app @@ -91,10 +85,26 @@ end class ::ApplicationController < ActionController::Base end +module ActionController + class << Routing + def possible_controllers + @@possible_controllers ||= [] + end + end + + class Base + def self.inherited(klass) + name = klass.name.underscore.sub(/_controller$/, '') + ActionController::Routing.possible_controllers << name unless name.blank? + super + end + end +end + class SimpleRouteCase < Rack::TestCase setup do ActionController::Routing::Routes.draw do |map| map.connect ':controller/:action/:id' end end -end
\ No newline at end of file +end |