diff options
Diffstat (limited to 'actionpack/test/abstract_controller')
-rw-r--r-- | actionpack/test/abstract_controller/abstract_controller_test.rb | 22 | ||||
-rw-r--r-- | actionpack/test/abstract_controller/layouts_test.rb | 2 |
2 files changed, 10 insertions, 14 deletions
diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb index 331797afcf..cf6fb5140d 100644 --- a/actionpack/test/abstract_controller/abstract_controller_test.rb +++ b/actionpack/test/abstract_controller/abstract_controller_test.rb @@ -58,11 +58,11 @@ module AbstractController end def rendering_to_body - render_to_body "naked_render.erb" + self.response_body = render_to_body :_template_name => "naked_render.erb" end def rendering_to_string - render_to_string "naked_render.erb" + self.response_body = render_to_string :_template_name => "naked_render.erb" end end @@ -136,6 +136,11 @@ module AbstractController class WithLayouts < PrefixedViews use Layouts + def self.inherited(klass) + klass._write_layout_method + super + end + private def self.layout(formats) begin @@ -147,13 +152,9 @@ module AbstractController end end end - - def _layout - self.class.layout(formats) - end - + def render_to_body(options = {}) - options[:_layout] = options[:layout] || _layout + options[:_layout] = options[:layout] || _default_layout super end end @@ -175,11 +176,6 @@ module AbstractController result = Me4.process(:index) assert_equal "Me4 Enter : Hello from me4/index.erb : Exit", result.response_obj[:body] end - - test "it can fall back to the application layout" do - result = Me5.process(:index) - assert_equal "Application Enter : Hello from me5/index.erb : Exit", result.response_obj[:body] - end end # respond_to_action?(action_name) diff --git a/actionpack/test/abstract_controller/layouts_test.rb b/actionpack/test/abstract_controller/layouts_test.rb index 3d4570bfef..078e0037a8 100644 --- a/actionpack/test/abstract_controller/layouts_test.rb +++ b/actionpack/test/abstract_controller/layouts_test.rb @@ -8,7 +8,7 @@ module AbstractControllerTests use AbstractController::Renderer use AbstractController::Layouts - self.view_paths = [ActionView::FixtureTemplate::FixturePath.new( + self.view_paths = [ActionView::Template::FixturePath.new( "layouts/hello.erb" => "With String <%= yield %>", "layouts/hello_override.erb" => "With Override <%= yield %>", "layouts/abstract_controller_tests/layouts/with_string_implied_child.erb" => |