From 1d3e2c2b7333c90f2ef26fd0a3c6184aeaeb7e8a Mon Sep 17 00:00:00 2001 From: Yehuda Katz and Carl Lerche Date: Mon, 23 Mar 2009 18:06:47 -0700 Subject: In the middle of some refactoring... some fails due to changes in AbstractController not yet reflected in ActionController tests --- actionpack/test/new_base/render_text_test.rb | 11 ++++++++--- actionpack/test/new_base/test_helper.rb | 12 +++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'actionpack/test/new_base') 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 e33b4239ad..c472a943e5 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') -- cgit v1.2.3