diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/deprecated_instance_variables_test.rb | 48 | ||||
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 11 |
2 files changed, 3 insertions, 56 deletions
diff --git a/actionpack/test/controller/deprecated_instance_variables_test.rb b/actionpack/test/controller/deprecated_instance_variables_test.rb deleted file mode 100644 index 7865a69e30..0000000000 --- a/actionpack/test/controller/deprecated_instance_variables_test.rb +++ /dev/null @@ -1,48 +0,0 @@ -require File.dirname(__FILE__) + '/../abstract_unit' - -class DeprecatedControllerInstanceVariablesTest < Test::Unit::TestCase - class Target < ActionController::Base - def initialize(run = nil) - instance_eval(run) if run - super() - end - - def noop - render :nothing => true - end - - ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| - class_eval "def old_#{var}; render :text => @#{var}.to_s end" - class_eval "def new_#{var}; render :text => #{var}.to_s end" - class_eval "def internal_#{var}; render :text => @_#{var}.to_s end" - end - - def rescue_action(e) raise e end - end - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = Target.new - end - - ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| - class_eval <<-end_eval, __FILE__, __LINE__ - def test_old_#{var}_is_deprecated - assert_deprecated('@#{var}') { get :old_#{var} } - end - def test_new_#{var}_isnt_deprecated - assert_not_deprecated { get :new_#{var} } - end - def test_internal_#{var}_isnt_deprecated - assert_not_deprecated { get :internal_#{var} } - end - def test_#{var}_raises_if_already_set - assert_raise(RuntimeError) do - @controller = Target.new '@#{var} = Object.new' - get :noop - end - end - end_eval - end -end diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 3eb84e6d24..0765772e06 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -460,14 +460,9 @@ class NewRenderTest < Test::Unit::TestCase ActionController::Base.protected_variables_cache = nil get :hello_world - assert assigns.include?('request'), 'request should be in assigns' - assert_deprecated 'request' do - assert_kind_of ActionController::AbstractRequest, assigns['request'] - end - assert_not_deprecated do - assert_kind_of ActionController::AbstractRequest, @response.template.request - assert_kind_of ActionController::AbstractRequest, assigns['_request'] - end + 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 |