1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #23862 from prathamesh-sonpatki/test-for-strong-etag

Added a test for generating Strong ETag
This commit is contained in:
Rafael França 2016-02-24 20:40:34 -03:00
commit 8db771bb69

View file

@ -445,4 +445,12 @@ class ResponseIntegrationTest < ActionDispatch::IntegrationTest
assert_equal('application/xml; charset=utf-16', @response.headers['Content-Type']) assert_equal('application/xml; charset=utf-16', @response.headers['Content-Type'])
end 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 end