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

Changeset 1190

Show
Ignore:
Timestamp:
04/17/05 11:47:54 (3 years ago)
Author:
david
Message:

Hide the deprecated methods from the docs

Files:

Legend:

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

    r1189 r1190  
    6060      end 
    6161 
    62       # Asserts that the request was rendered with the appropriate template file 
    63       def assert_template(expected=nil, message=nil) 
     62      # Asserts that the request was rendered with the appropriate template file. 
     63      def assert_template(expected = nil, message=nil) 
    6464        rendered = expected ? @response.rendered_file(!expected.include?('/')) : @response.rendered_file 
    6565        msg = build_message(message, "expecting <?> but rendering with <?>", expected, rendered) 
     
    7272        end 
    7373      end 
    74  
    75       alias_method :assert_rendered_file, :assert_template #:nodoc: 
    76        
    77       # -- routing assertions -------------------------------------------------- 
    7874 
    7975      # Asserts that the routing of the given path is handled correctly and that the parsed options match. 
  • trunk/actionpack/lib/action_controller/deprecated_assertions.rb

    r1189 r1190  
    55module Test #:nodoc: 
    66  module Unit #:nodoc: 
    7     module Assertions #:nodoc: 
    8       def assert_success(message=nil) 
     7    module Assertions 
     8      def assert_success(message=nil) #:nodoc: 
    99        assert_response(:success, message) 
    1010      end 
    1111 
    12       def assert_redirect(message=nil) 
     12      def assert_redirect(message=nil) #:nodoc: 
    1313        assert_response(:redirect, message) 
    1414      end 
    1515 
     16      def assert_rendered_file(expected=nil, message=nil) #:nodoc: 
     17        assert_template(expected, message) 
     18      end 
     19 
    1620      # ensure that the session has an object with the specified name 
    17       def assert_session_has(key=nil, message=nil) 
     21      def assert_session_has(key=nil, message=nil) #:nodoc: 
    1822        msg = build_message(message, "<?> is not in the session <?>", key, @response.session) 
    1923        assert_block(msg) { @response.has_session_object?(key) } 
     
    2125 
    2226      # ensure that the session has no object with the specified name 
    23       def assert_session_has_no(key=nil, message=nil) 
     27      def assert_session_has_no(key=nil, message=nil) #:nodoc: 
    2428        msg = build_message(message, "<?> is in the session <?>", key, @response.session) 
    2529        assert_block(msg) { !@response.has_session_object?(key) } 
    2630      end 
    2731 
    28       def assert_session_equal(expected = nil, key = nil, message = nil) 
     32      def assert_session_equal(expected = nil, key = nil, message = nil) #:nodoc: 
    2933        msg = build_message(message, "<?> expected in session['?'] but was <?>", expected, key, @response.session[key]) 
    3034        assert_block(msg) { expected == @response.session[key] } 
     
    3337      # -- cookie assertions --------------------------------------------------- 
    3438 
    35       def assert_no_cookie(key = nil, message = nil) 
     39      def assert_no_cookie(key = nil, message = nil) #:nodoc: 
    3640        actual = @response.cookies[key] 
    3741        msg = build_message(message, "<?> not expected in cookies['?']", actual, key) 
     
    3943      end 
    4044     
    41       def assert_cookie_equal(expected = nil, key = nil, message = nil) 
     45      def assert_cookie_equal(expected = nil, key = nil, message = nil) #:nodoc: 
    4246        actual = @response.cookies[key] 
    4347        actual = actual.first if actual 
     
    4953 
    5054      # ensure that the flash has an object with the specified name 
    51       def assert_flash_has(key=nil, message=nil) 
     55      def assert_flash_has(key=nil, message=nil) #:nodoc: 
    5256        msg = build_message(message, "<?> is not in the flash <?>", key, @response.flash) 
    5357        assert_block(msg) { @response.has_flash_object?(key) } 
     
    5559 
    5660      # ensure that the flash has no object with the specified name 
    57       def assert_flash_has_no(key=nil, message=nil) 
     61      def assert_flash_has_no(key=nil, message=nil) #:nodoc: 
    5862        msg = build_message(message, "<?> is in the flash <?>", key, @response.flash) 
    5963        assert_block(msg) { !@response.has_flash_object?(key) } 
     
    6165 
    6266      # ensure the flash exists 
    63       def assert_flash_exists(message=nil) 
     67      def assert_flash_exists(message=nil) #:nodoc: 
    6468        msg = build_message(message, "the flash does not exist <?>", @response.session['flash'] ) 
    6569        assert_block(msg) { @response.has_flash? } 
     
    6771 
    6872      # ensure the flash does not exist 
    69       def assert_flash_not_exists(message=nil) 
     73      def assert_flash_not_exists(message=nil) #:nodoc: 
    7074        msg = build_message(message, "the flash exists <?>", @response.flash) 
    7175        assert_block(msg) { !@response.has_flash? } 
     
    7377     
    7478      # ensure the flash is empty but existent 
    75       def assert_flash_empty(message=nil) 
     79      def assert_flash_empty(message=nil) #:nodoc: 
    7680        msg = build_message(message, "the flash is not empty <?>", @response.flash) 
    7781        assert_block(msg) { !@response.has_flash_with_contents? } 
     
    7983 
    8084      # ensure the flash is not empty 
    81       def assert_flash_not_empty(message=nil) 
     85      def assert_flash_not_empty(message=nil) #:nodoc: 
    8286        msg = build_message(message, "the flash is empty") 
    8387        assert_block(msg) { @response.has_flash_with_contents? } 
    8488      end 
    8589     
    86       def assert_flash_equal(expected = nil, key = nil, message = nil) 
     90      def assert_flash_equal(expected = nil, key = nil, message = nil) #:nodoc: 
    8791        msg = build_message(message, "<?> expected in flash['?'] but was <?>", expected, key, @response.flash[key]) 
    8892        assert_block(msg) { expected == @response.flash[key] } 
     
    9195 
    9296      # ensure our redirection url is an exact match 
    93       def assert_redirect_url(url=nil, message=nil) 
     97      def assert_redirect_url(url=nil, message=nil) #:nodoc: 
    9498        assert_redirect(message) 
    9599        msg = build_message(message, "<?> is not the redirected location <?>", url, @response.redirect_url) 
     
    98102 
    99103      # ensure our redirection url matches a pattern 
    100       def assert_redirect_url_match(pattern=nil, message=nil) 
     104      def assert_redirect_url_match(pattern=nil, message=nil) #:nodoc: 
    101105        assert_redirect(message) 
    102106        msg = build_message(message, "<?> was not found in the location: <?>", pattern, @response.redirect_url) 
     
    108112 
    109113      # ensure that a template object with the given name exists 
    110       def assert_template_has(key=nil, message=nil) 
     114      def assert_template_has(key=nil, message=nil) #:nodoc: 
    111115        msg = build_message(message, "<?> is not a template object", key ) 
    112116        assert_block(msg) { @response.has_template_object?(key) } 
     
    114118 
    115119      # ensure that a template object with the given name does not exist 
    116       def assert_template_has_no(key=nil,message=nil) 
     120      def assert_template_has_no(key=nil,message=nil) #:nodoc: 
    117121        msg = build_message(message, "<?> is a template object <?>", key, @response.template_objects[key]) 
    118122        assert_block(msg) { !@response.has_template_object?(key) } 
     
    120124 
    121125      # ensures that the object assigned to the template on +key+ is equal to +expected+ object. 
    122       def assert_template_equal(expected = nil, key = nil, message = nil) 
     126      def assert_template_equal(expected = nil, key = nil, message = nil) #:nodoc: 
    123127        msg = build_message(message, "<?> expected in assigns['?'] but was <?>", expected, key, @response.template.assigns[key.to_s]) 
    124128        assert_block(msg) { expected == @response.template.assigns[key.to_s] } 
     
    128132      # Asserts that the template returns the +expected+ string or array based on the XPath +expression+. 
    129133      # This will only work if the template rendered a valid XML document. 
    130       def assert_template_xpath_match(expression=nil, expected=nil, message=nil) 
     134      def assert_template_xpath_match(expression=nil, expected=nil, message=nil) #:nodoc: 
    131135        xml, matches = REXML::Document.new(@response.body), [] 
    132136        xml.elements.each(expression) { |e| matches << e.text } 
     
    144148 
    145149      # Assert the template object with the given name is an Active Record descendant and is valid. 
    146       def assert_valid_record(key = nil, message = nil) 
     150      def assert_valid_record(key = nil, message = nil) #:nodoc: 
    147151        record = find_record_in_template(key) 
    148152        msg = build_message(message, "Active Record is invalid <?>)", record.errors.full_messages) 
     
    151155 
    152156      # Assert the template object with the given name is an Active Record descendant and is invalid. 
    153       def assert_invalid_record(key = nil, message = nil) 
     157      def assert_invalid_record(key = nil, message = nil) #:nodoc: 
    154158        record = find_record_in_template(key) 
    155159        msg = build_message(message, "Active Record is valid)") 
     
    158162 
    159163      # Assert the template object with the given name is an Active Record descendant and the specified column(s) are valid. 
    160       def assert_valid_column_on_record(key = nil, columns = "", message = nil) 
     164      def assert_valid_column_on_record(key = nil, columns = "", message = nil) #:nodoc: 
    161165        record = find_record_in_template(key) 
    162166        record.send(:validate) 
     
    169173 
    170174      # Assert the template object with the given name is an Active Record descendant and the specified column(s) are invalid. 
    171       def assert_invalid_column_on_record(key = nil, columns = "", message = nil) 
     175      def assert_invalid_column_on_record(key = nil, columns = "", message = nil) #:nodoc: 
    172176        record = find_record_in_template(key) 
    173177        record.send(:validate)