Ticket #8493: render_component_shouldnt_set_etag.diff
| File render_component_shouldnt_set_etag.diff, 1.5 kB (added by jsierles, 2 years ago) |
|---|
-
lib/action_controller/base.rb
old new 496 496 assign_default_content_type_and_charset 497 497 498 498 response.request = request 499 response.prepare! 499 response.prepare! unless component_request? 500 500 response 501 501 ensure 502 502 process_cleanup -
test/controller/components_test.rb
old new 96 96 assert_equal "Ring, ring: Lady of the House, speaking", @response.body 97 97 end 98 98 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 99 105 def test_internal_calling 100 106 get :internal_caller 101 107 assert_equal "Are you there? Yes, ma'am", @response.body … … 109 115 get :use_flash 110 116 assert_equal 'no flash', @response.body 111 117 end 112 118 113 119 def test_component_redirect_redirects 114 120 get :calling_redirected 115 121 … … 126 132 127 133 assert_equal "Lady of the House, speaking", @response.body 128 134 end 135 136 protected 137 138 def etag_for(text) 139 %("#{Digest::MD5.hexdigest(text)}") 140 end 141 129 142 end