Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4052 from lest/warning-variable-for-layout

remove warnings about @variable_for_layout
  • Loading branch information...
commit 9f3f2b2e070529d84fa750cabec031b418c0d16f 2 parents 45e85c3 + c3c1ff4
@josevalim josevalim authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 actionpack/test/controller/render_test.rb
View
11 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",
Please sign in to comment.
Something went wrong with that request. Please try again.