aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base
diff options
context:
space:
mode:
authorYehuda Katz and Carl Lerche <wycats@gmail.com>2009-04-06 12:35:44 -0700
committerYehuda Katz and Carl Lerche <wycats@gmail.com>2009-04-06 12:35:44 -0700
commit9c8eaf8e254cf8ccaa6ecae3fdf1f468fbb60db8 (patch)
tree9f5a7e72bcd1fecc54499e21f3e4ebb2ea62da1a /actionpack/test/new_base
parent4d3cd9b43f6b7425ca3eee303773d2221e8af38f (diff)
parent1d3e2c2b7333c90f2ef26fd0a3c6184aeaeb7e8a (diff)
downloadrails-9c8eaf8e254cf8ccaa6ecae3fdf1f468fbb60db8.tar.gz
rails-9c8eaf8e254cf8ccaa6ecae3fdf1f468fbb60db8.tar.bz2
rails-9c8eaf8e254cf8ccaa6ecae3fdf1f468fbb60db8.zip
Merge branch 'abstract_controller' of git@github.com:wycats/rails into abstract_controller
Diffstat (limited to 'actionpack/test/new_base')
-rw-r--r--actionpack/test/new_base/render_text_test.rb11
-rw-r--r--actionpack/test/new_base/test_helper.rb12
2 files changed, 17 insertions, 6 deletions
diff --git a/actionpack/test/new_base/render_text_test.rb b/actionpack/test/new_base/render_text_test.rb
index b80a9b4a79..a20ca5fb8c 100644
--- a/actionpack/test/new_base/render_text_test.rb
+++ b/actionpack/test/new_base/render_text_test.rb
@@ -1,5 +1,8 @@
require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
+class ApplicationController < ActionController::Base2
+end
+
module HappyPath
class RenderTextWithoutLayoutsController < ActionController::Base2
@@ -10,11 +13,11 @@ module HappyPath
end
end
- class RenderTextWithLayoutsController < ActionController::Base2
+ class RenderTextWithLayoutsController < ::ApplicationController
self.view_paths = [ActionView::FixtureTemplate::FixturePath.new(
"layouts/application.html.erb" => "<%= yield %>, I'm here!",
"layouts/greetings.html.erb" => "<%= yield %>, I wish thee well."
- )]
+ )]
def render_hello_world
render :text => "hello david"
@@ -136,4 +139,6 @@ module HappyPath
assert_body "hello world"
assert_status 200
end
-end \ No newline at end of file
+end
+
+ActionController::Base2.app_loaded! \ No newline at end of file
diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb
index 5ed4dd3f12..420abe58f7 100644
--- a/actionpack/test/new_base/test_helper.rb
+++ b/actionpack/test/new_base/test_helper.rb
@@ -38,12 +38,18 @@ module ActionController
include ActionController::Renderer
def self.inherited(klass)
- @subclasses ||= []
- @subclasses << klass.to_s
+ ::ActionController::Base2.subclasses << klass.to_s
+ super
end
def self.subclasses
- @subclasses
+ @subclasses ||= []
+ end
+
+ def self.app_loaded!
+ @subclasses.each do |subclass|
+ subclass.constantize._write_layout_method
+ end
end
# append_view_path File.join(File.dirname(__FILE__), '..', 'fixtures')