aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-20 05:11:06 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-20 05:11:06 -0800
commit9f3f2b2e070529d84fa750cabec031b418c0d16f (patch)
tree960c142bd3982cdce614a41e6697a659b3e6b934
parent45e85c358d07b90fc52136c51a4511158e51849e (diff)
parentc3c1ff40fcc4cbc31a5396a8b7737755ad4bc95b (diff)
downloadrails-9f3f2b2e070529d84fa750cabec031b418c0d16f.tar.gz
rails-9f3f2b2e070529d84fa750cabec031b418c0d16f.tar.bz2
rails-9f3f2b2e070529d84fa750cabec031b418c0d16f.zip
Merge pull request #4052 from lest/warning-variable-for-layout
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",