From c3c1ff40fcc4cbc31a5396a8b7737755ad4bc95b Mon Sep 17 00:00:00 2001 From: lest Date: Tue, 20 Dec 2011 15:37:20 +0300 Subject: [PATCH] remove warnings about @variable_for_layout --- actionpack/test/controller/render_test.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 243bad874990e..f42a04d670d24 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -25,6 +25,8 @@ def new class TestController < ActionController::Base protect_from_forgery + before_filter :set_variable_for_layout + class LabellingFormBuilder < ActionView::Helpers::FormBuilder end @@ -364,17 +366,14 @@ def render_action_hello_world_as_symbol end def layout_test_with_different_layout - @variable_for_layout = nil render :action => "hello_world", :layout => "standard" end def layout_test_with_different_layout_and_string_action - @variable_for_layout = nil render "hello_world", :layout => "standard" end def layout_test_with_different_layout_and_symbol_action - @variable_for_layout = nil render :hello_world, :layout => "standard" end @@ -383,7 +382,6 @@ def rendering_without_layout end def layout_overriding_layout - @variable_for_layout = nil render :action => "hello_world", :layout => "standard" end @@ -666,8 +664,11 @@ def render_with_filters private + def set_variable_for_layout + @variable_for_layout = nil + end + def determine_layout - @variable_for_layout ||= nil case action_name when "hello_world", "layout_test", "rendering_without_layout", "rendering_nothing_on_layout", "render_text_hello_world",