Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4824

Show
Ignore:
Timestamp:
08/26/06 05:58:16 (2 years ago)
Author:
bitsweat
Message:

Deprecation: test deprecated instance vars in partials.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r4822 r4824  
    11*SVN* 
    22 
    3 * Changed the POST parameter processing to use the new QueryStringParser [DHH] 
     3* Deprecation: test deprecated instance vars in partials. [Jeremy Kemper] 
     4 
     5* Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH] 
    46 
    57* Add UrlWriter to allow writing urls from Mailers and scripts. [Nicholas Seckar] 
  • trunk/actionpack/test/controller/deprecated_instance_variables_test.rb

    r4717 r4824  
    11require File.dirname(__FILE__) + '/../abstract_unit' 
    22 
    3 class DeprecatedInstanceVariablesTest < Test::Unit::TestCase 
     3class DeprecatedControllerInstanceVariablesTest < Test::Unit::TestCase 
    44  class Target < ActionController::Base 
    55    def initialize(run = nil) 
  • trunk/actionpack/test/template/deprecated_instance_variables_test.rb

    r4715 r4824  
    11require File.dirname(__FILE__) + '/../abstract_unit' 
    22 
    3 class DeprecatedInstanceVariablesTest < Test::Unit::TestCase 
    4   class Target < ActionController::Base 
     3class DeprecatedViewInstanceVariablesTest < Test::Unit::TestCase 
     4  class DeprecatedInstanceVariablesController < ActionController::Base 
     5    self.template_root = "#{File.dirname(__FILE__)}/../fixtures/" 
     6 
     7    def self.controller_path; 'deprecated_instance_variables' end 
     8 
    59    ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| 
    610      class_eval <<-end_eval 
    7         def old_#{var}; render :inline => '<%= @#{var}.inspect %>'  end 
    8         def new_#{var}; render :inline => '<%= #{var}.inspect %>'   end 
     11        def old_#{var}_inline;  render :inline => '<%= @#{var}.inspect %>'  end 
     12        def new_#{var}_inline;  render :inline => '<%= #{var}.inspect %>'   end 
     13        def old_#{var}_partial; render :partial => '#{var}_ivar'    end 
     14        def new_#{var}_partial; render :partial => '#{var}_method'  end 
    915      end_eval 
    1016    end 
     
    1622    @request    = ActionController::TestRequest.new 
    1723    @response   = ActionController::TestResponse.new 
    18     @controller = Target.new 
     24    @controller = DeprecatedInstanceVariablesController.new 
    1925  end 
    2026 
     
    2228    class_eval <<-end_eval, __FILE__, __LINE__ 
    2329      def test_old_#{var}_is_deprecated 
    24         assert_deprecated('@#{var}') { get :old_#{var}
     30        assert_deprecated('@#{var}') { get :old_#{var}_inline
    2531      end 
    2632      def test_new_#{var}_isnt_deprecated 
    27         assert_not_deprecated { get :new_#{var} } 
     33        assert_not_deprecated { get :new_#{var}_inline } 
     34      end 
     35      def test_old_#{var}_partial_is_deprecated 
     36        assert_deprecated('@#{var}') { get :old_#{var}_partial } 
     37      end 
     38      def test_new_#{var}_partial_isnt_deprecated 
     39        assert_not_deprecated { get :new_#{var}_partial } 
    2840      end 
    2941    end_eval