diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-26 05:58:16 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-26 05:58:16 +0000 |
commit | 96c6ca369a302d25c721f0cf2c9d28b0c51e2a69 (patch) | |
tree | 49459ffc8d55f3594071842b2632f1f6feaac1bf /actionpack/test/template | |
parent | 7b34d0f8c503789f00b1d312a0f24a4cd5c063c5 (diff) | |
download | rails-96c6ca369a302d25c721f0cf2c9d28b0c51e2a69.tar.gz rails-96c6ca369a302d25c721f0cf2c9d28b0c51e2a69.tar.bz2 rails-96c6ca369a302d25c721f0cf2c9d28b0c51e2a69.zip |
Deprecation: test deprecated instance vars in partials.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/deprecated_instance_variables_test.rb | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/actionpack/test/template/deprecated_instance_variables_test.rb b/actionpack/test/template/deprecated_instance_variables_test.rb index 86fc7d6139..277ecdf93d 100644 --- a/actionpack/test/template/deprecated_instance_variables_test.rb +++ b/actionpack/test/template/deprecated_instance_variables_test.rb @@ -1,11 +1,17 @@ require File.dirname(__FILE__) + '/../abstract_unit' -class DeprecatedInstanceVariablesTest < Test::Unit::TestCase - class Target < ActionController::Base +class DeprecatedViewInstanceVariablesTest < Test::Unit::TestCase + class DeprecatedInstanceVariablesController < ActionController::Base + self.template_root = "#{File.dirname(__FILE__)}/../fixtures/" + + def self.controller_path; 'deprecated_instance_variables' end + ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| class_eval <<-end_eval - def old_#{var}; render :inline => '<%= @#{var}.inspect %>' end - def new_#{var}; render :inline => '<%= #{var}.inspect %>' end + def old_#{var}_inline; render :inline => '<%= @#{var}.inspect %>' end + def new_#{var}_inline; render :inline => '<%= #{var}.inspect %>' end + def old_#{var}_partial; render :partial => '#{var}_ivar' end + def new_#{var}_partial; render :partial => '#{var}_method' end end_eval end @@ -15,16 +21,22 @@ class DeprecatedInstanceVariablesTest < Test::Unit::TestCase def setup @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new - @controller = Target.new + @controller = DeprecatedInstanceVariablesController.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} } + assert_deprecated('@#{var}') { get :old_#{var}_inline } end def test_new_#{var}_isnt_deprecated - assert_not_deprecated { get :new_#{var} } + assert_not_deprecated { get :new_#{var}_inline } + end + def test_old_#{var}_partial_is_deprecated + assert_deprecated('@#{var}') { get :old_#{var}_partial } + end + def test_new_#{var}_partial_isnt_deprecated + assert_not_deprecated { get :new_#{var}_partial } end end_eval end |