aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-08-25 23:34:48 -0500
committerJoshua Peek <josh@joshpeek.com>2009-08-25 23:34:48 -0500
commit78129b1731a1e6f3b091e996bcf55917d84b5f0e (patch)
treec0a67853e12d5825dfaf645de7292ef96b4c9ba8 /actionpack/test/new_base
parent5bc66f160d03bd60a748ac65728227ed9e4fc577 (diff)
downloadrails-78129b1731a1e6f3b091e996bcf55917d84b5f0e.tar.gz
rails-78129b1731a1e6f3b091e996bcf55917d84b5f0e.tar.bz2
rails-78129b1731a1e6f3b091e996bcf55917d84b5f0e.zip
Track all AC base subclasses as possible controllers for internal testing
Diffstat (limited to 'actionpack/test/new_base')
-rw-r--r--actionpack/test/new_base/test_helper.rb24
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