Remove ActionController::Base#view_controller_internals

Get rid of ActionController::Base#view_controller_internals flag and
use @@protected_view_variables for storing the list of controller
specific instance variables which should be inaccessible inside views.
This commit is contained in:
Pratik Naik
2008-04-21 03:38:16 +01:00
parent caa03a5c87
commit 2b69840e5e
4 changed files with 8 additions and 45 deletions

View File

@@ -529,26 +529,10 @@ class NewRenderTest < Test::Unit::TestCase
end
def test_access_to_request_in_view
view_internals_old_value = ActionController::Base.view_controller_internals
ActionController::Base.view_controller_internals = false
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
ActionController::Base.protected_variables_cache = nil
get :hello_world
assert !assigns.include?('request'), 'request should not be in assigns'
assert_kind_of ActionController::AbstractRequest, assigns['_request']
assert_kind_of ActionController::AbstractRequest, @response.template.request
ensure
ActionController::Base.view_controller_internals = view_internals_old_value
ActionController::Base.protected_variables_cache = nil
end
def test_render_xml