diff options
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index ff77e036fb..3818960979 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1210,7 +1210,7 @@ module ActionController #:nodoc: def add_instance_variables_to_assigns @@protected_variables_cache ||= Set.new(protected_instance_variables) - instance_variables.each do |var| + instance_variable_names.each do |var| next if @@protected_variables_cache.include?(var) @assigns[var[1..-1]] = instance_variable_get(var) end diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 8853311594..4cbb695f4c 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -373,7 +373,7 @@ module ActionController #:nodoc: # Sanity check for required instance variables so we can give an # understandable error message. %w(@controller @request @response).each do |iv_name| - if !(instance_variables.include?(iv_name) || instance_variables.include?(iv_name.to_sym)) || instance_variable_get(iv_name).nil? + if !(instance_variable_names.include?(iv_name) || instance_variable_names.include?(iv_name.to_sym)) || instance_variable_get(iv_name).nil? raise "#{iv_name} is nil: make sure you set it in your test's setup method." end end diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 3168daeaec..4c0b9d0c9c 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -495,6 +495,7 @@ class NewRenderTest < Test::Unit::TestCase ActionController::Base.protected_variables_cache = nil get :hello_world + assert !assigns.include?('_request'), '_request should not be in assigns' assert !assigns.include?('request'), 'request should not be in assigns' ActionController::Base.view_controller_internals = true |