aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlest <just.lest@gmail.com>2011-12-20 15:37:20 +0300
committerlest <just.lest@gmail.com>2011-12-20 15:53:24 +0300
commitc3c1ff40fcc4cbc31a5396a8b7737755ad4bc95b (patch)
tree960c142bd3982cdce614a41e6697a659b3e6b934
parent45e85c358d07b90fc52136c51a4511158e51849e (diff)
downloadrails-c3c1ff40fcc4cbc31a5396a8b7737755ad4bc95b.tar.gz
rails-c3c1ff40fcc4cbc31a5396a8b7737755ad4bc95b.tar.bz2
rails-c3c1ff40fcc4cbc31a5396a8b7737755ad4bc95b.zip
remove warnings about @variable_for_layout
-rw-r--r--actionpack/test/controller/render_test.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 243bad8749..f42a04d670 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -25,6 +25,8 @@ end
class TestController < ActionController::Base
protect_from_forgery
+ before_filter :set_variable_for_layout
+
class LabellingFormBuilder < ActionView::Helpers::FormBuilder
end
@@ -364,17 +366,14 @@ class TestController < ActionController::Base
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 @@ class TestController < ActionController::Base
end
def layout_overriding_layout
- @variable_for_layout = nil
render :action => "hello_world", :layout => "standard"
end
@@ -666,8 +664,11 @@ class TestController < ActionController::Base
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",