From e275479ce5ea6126aa1dc2f964b6d06d07098e00 Mon Sep 17 00:00:00 2001 From: brainopia Date: Mon, 5 Jan 2015 15:06:42 +0300 Subject: Reset template assertions without warnings --- actionpack/lib/action_controller/test_case.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 2e6c58b83a..d30615fade 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -66,8 +66,10 @@ module ActionController def reset_template_assertion RENDER_TEMPLATE_INSTANCE_VARIABLES.each do |instance_variable| - ivar = instance_variable_get("@_#{instance_variable}") - ivar.clear if ivar + ivar_name = "@_#{instance_variable}" + if instance_variable_defined?(ivar_name) + instance_variable_get(ivar_name).clear + end end end -- cgit v1.2.3