aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-02-24 20:40:34 -0300
committerRafael França <rafaelmfranca@gmail.com>2016-02-24 20:40:34 -0300
commit8db771bb6977b83408317b6588967d288f5a44cc (patch)
tree2a89db068a1a3690f40be7be845e2c12ba1a712b /actionpack
parentb5431d7843cc286586a5ed43c1f92e35cacec07e (diff)
parent641bb39bb22be004f4c36dce34dfbdfdb3a4bc77 (diff)
downloadrails-8db771bb6977b83408317b6588967d288f5a44cc.tar.gz
rails-8db771bb6977b83408317b6588967d288f5a44cc.tar.bz2
rails-8db771bb6977b83408317b6588967d288f5a44cc.zip
Merge pull request #23862 from prathamesh-sonpatki/test-for-strong-etag
Added a test for generating Strong ETag
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/dispatch/response_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 8b3849cb7a..cd385982d9 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -445,4 +445,12 @@ class ResponseIntegrationTest < ActionDispatch::IntegrationTest
assert_equal('application/xml; charset=utf-16', @response.headers['Content-Type'])
end
+
+ test "we can set strong ETag by directly adding it as header" do
+ @response = ActionDispatch::Response.create
+ @response.add_header "ETag", '"202cb962ac59075b964b07152d234b70"'
+
+ assert_equal('"202cb962ac59075b964b07152d234b70"', @response.etag)
+ assert_equal('"202cb962ac59075b964b07152d234b70"', @response.headers['ETag'])
+ end
end