diff options
author | José Valim <jose.valim@gmail.com> | 2011-10-02 11:28:48 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-10-02 11:29:13 +0200 |
commit | 6e8fe1bf021139a2fbd06a10778ad2c6b67930ef (patch) | |
tree | 2f03dd143a8210bffaeb3bf400d43a284f31ed35 /actionpack/lib/action_dispatch | |
parent | 63f6da050acb1108a3f22c2bd393a8c2c05caeea (diff) | |
download | rails-6e8fe1bf021139a2fbd06a10778ad2c6b67930ef.tar.gz rails-6e8fe1bf021139a2fbd06a10778ad2c6b67930ef.tar.bz2 rails-6e8fe1bf021139a2fbd06a10778ad2c6b67930ef.zip |
TestCase should respect the view_assigns API instead of pulling variables on its own.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/test_process.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/testing/test_process.rb b/actionpack/lib/action_dispatch/testing/test_process.rb index f668b81b45..b08ff41950 100644 --- a/actionpack/lib/action_dispatch/testing/test_process.rb +++ b/actionpack/lib/action_dispatch/testing/test_process.rb @@ -5,12 +5,7 @@ require 'active_support/core_ext/hash/indifferent_access' module ActionDispatch module TestProcess def assigns(key = nil) - assigns = {}.with_indifferent_access - @controller.instance_variable_names.each do |ivar| - next if ActionController::Base.protected_instance_variables.include?(ivar) - assigns[ivar[1..-1]] = @controller.instance_variable_get(ivar) - end - + assigns = @controller.view_assigns.with_indifferent_access key.nil? ? assigns : assigns[key] end |