aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorbrainopia <brainopia@evilmartians.com>2015-01-05 15:06:42 +0300
committerbrainopia <brainopia@evilmartians.com>2015-01-05 15:06:42 +0300
commite275479ce5ea6126aa1dc2f964b6d06d07098e00 (patch)
tree499ae5cd3fceac4cb5b5f701d1cd1a58a4aaca2a /actionpack
parente50064c130f8b6465a78928e38588196515ccf27 (diff)
downloadrails-e275479ce5ea6126aa1dc2f964b6d06d07098e00.tar.gz
rails-e275479ce5ea6126aa1dc2f964b6d06d07098e00.tar.bz2
rails-e275479ce5ea6126aa1dc2f964b6d06d07098e00.zip
Reset template assertions without warnings
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/test_case.rb6
1 files 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