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

Changeset 6875

Show
Ignore:
Timestamp:
05/27/07 23:48:28 (1 year ago)
Author:
bitsweat
Message:

Don't prepare response when rendering a component. Closes #8493.

Files:

Legend:

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

    r6871 r6875  
    11*SVN* 
     2 
     3* Don't prepare response when rendering a component.  #8493 [jsierles] 
    24 
    35* Reduce file stat calls when checking for template changes.  #7736 [alex] 
  • trunk/actionpack/lib/action_controller/base.rb

    r6862 r6875  
    497497 
    498498        response.request = request 
    499         response.prepare! 
     499        response.prepare! unless component_request? 
    500500        response 
    501501      ensure 
  • trunk/actionpack/test/controller/components_test.rb

    r6403 r6875  
    9797  end 
    9898 
     99  def test_etag_is_set_for_parent_template_when_calling_from_template 
     100    get :calling_from_template 
     101    expected_etag = etag_for("Ring, ring: Lady of the House, speaking") 
     102    assert_equal expected_etag, @response.headers['ETag'] 
     103  end 
     104 
    99105  def test_internal_calling 
    100106    get :internal_caller 
     
    127133    assert_equal "Lady of the House, speaking", @response.body 
    128134  end 
     135 
     136  protected 
     137    def etag_for(text) 
     138      %("#{Digest::MD5.hexdigest(text)}") 
     139    end 
    129140end