Skip to content

Commit

Permalink
remove warnings about @variable_for_layout
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
lest authored and josevalim committed Dec 20, 2011
1 parent 2305a98 commit e97aa2c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions actionpack/test/controller/render_test.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -383,7 +382,6 @@ def rendering_without_layout
end

def layout_overriding_layout
@variable_for_layout = nil
render :action => "hello_world", :layout => "standard"
end

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit e97aa2c

Please sign in to comment.