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

Changeset 4938

Show
Ignore:
Timestamp:
09/03/06 20:36:51 (2 years ago)
Author:
david
Message:

Deprecate deprecated assertions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/assertions/deprecated_assertions.rb

    r4935 r4938  
    77        assert_response(:success, message) 
    88      end 
     9      deprecate :assert_success 
    910 
    1011      def assert_redirect(message=nil) #:nodoc: 
    1112        assert_response(:redirect, message) 
    1213      end 
     14      deprecate :assert_redirect 
    1315 
    1416      def assert_rendered_file(expected=nil, message=nil) #:nodoc: 
    1517        assert_template(expected, message) 
    1618      end 
     19      deprecate :assert_rendered_file 
    1720 
    1821      # ensure that the session has an object with the specified name 
     
    2124        assert_block(msg) { @response.has_session_object?(key) } 
    2225      end 
     26      deprecate :assert_session_has 
    2327 
    2428      # ensure that the session has no object with the specified name 
     
    2731        assert_block(msg) { !@response.has_session_object?(key) } 
    2832      end 
     33      deprecate :assert_session_has_no 
    2934 
    3035      def assert_session_equal(expected = nil, key = nil, message = nil) #:nodoc: 
     
    3237        assert_block(msg) { expected == @response.session[key] } 
    3338      end 
     39      deprecate :assert_session_equal 
    3440 
    3541      # -- cookie assertions --------------------------------------------------- 
     
    4046        assert_block(msg) { actual.nil? or actual.empty? } 
    4147      end 
     48      deprecate :assert_no_cookie 
    4249     
    4350      def assert_cookie_equal(expected = nil, key = nil, message = nil) #:nodoc: 
     
    4754        assert_block(msg) { expected == actual } 
    4855      end 
     56      deprecate :assert_cookie_equal 
    4957     
    5058      # -- flash assertions --------------------------------------------------- 
     
    5563        assert_block(msg) { @response.has_flash_object?(key) } 
    5664      end 
     65      deprecate :assert_flash_has 
    5766 
    5867      # ensure that the flash has no object with the specified name 
     
    6170        assert_block(msg) { !@response.has_flash_object?(key) } 
    6271      end 
     72      deprecate :assert_flash_has_no 
    6373 
    6474      # ensure the flash exists 
     
    6777        assert_block(msg) { @response.has_flash? } 
    6878      end 
     79      deprecate :assert_flash_exists 
    6980 
    7081      # ensure the flash does not exist 
     
    7384        assert_block(msg) { !@response.has_flash? } 
    7485      end 
     86      deprecate :assert_flash_not_exists 
    7587     
    7688      # ensure the flash is empty but existent 
     
    7991        assert_block(msg) { !@response.has_flash_with_contents? } 
    8092      end 
     93      deprecate :assert_flash_empty 
    8194 
    8295      # ensure the flash is not empty 
     
    8598        assert_block(msg) { @response.has_flash_with_contents? } 
    8699      end 
     100      deprecate :assert_flash_not_empty 
    87101     
    88102      def assert_flash_equal(expected = nil, key = nil, message = nil) #:nodoc: 
     
    90104        assert_block(msg) { expected == @response.flash[key] } 
    91105      end 
     106      deprecate :assert_flash_equal 
    92107     
    93108 
     
    98113        assert_block(msg) { @response.redirect_url == url } 
    99114      end 
     115      deprecate :assert_redirect_url 
    100116 
    101117      # ensure our redirection url matches a pattern 
     
    105121        assert_block(msg) { @response.redirect_url_match?(pattern) } 
    106122      end 
     123      deprecate :assert_redirect_url_match 
    107124 
    108125     
     
    114131        assert_block(msg) { @response.has_template_object?(key) } 
    115132      end 
     133      deprecate :assert_template_has 
    116134 
    117135      # ensure that a template object with the given name does not exist 
     
    120138        assert_block(msg) { !@response.has_template_object?(key) } 
    121139      end 
     140      deprecate :assert_template_has_no 
    122141 
    123142      # ensures that the object assigned to the template on +key+ is equal to +expected+ object. 
     
    127146      end 
    128147      alias_method :assert_assigned_equal, :assert_template_equal 
     148      deprecate :assert_assigned_equal 
     149      deprecate :assert_template_equal 
    129150 
    130151      # Asserts that the template returns the +expected+ string or array based on the XPath +expression+. 
     
    144165        assert_block(msg) { matches == expected } 
    145166      end 
     167      deprecate :assert_template_xpath_match 
    146168 
    147169      # Assert the template object with the given name is an Active Record descendant and is valid. 
     
    151173        assert_block(msg) { record.valid? } 
    152174      end 
     175      deprecate :assert_valid_record 
    153176 
    154177      # Assert the template object with the given name is an Active Record descendant and is invalid. 
     
    158181        assert_block(msg) { !record.valid? } 
    159182      end 
     183      deprecate :assert_invalid_record 
    160184 
    161185      # Assert the template object with the given name is an Active Record descendant and the specified column(s) are valid. 
     
    169193        assert_block(msg) { cols.empty? } 
    170194      end 
     195      deprecate :assert_valid_column_on_record 
    171196 
    172197      # Assert the template object with the given name is an Active Record descendant and the specified column(s) are invalid. 
     
    180205        assert_block(msg) { cols.empty? } 
    181206      end 
     207      deprecate :assert_invalid_column_on_record 
    182208 
    183209      private