aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorabhishek <bigbeliever@gmail.com>2014-11-10 10:53:31 +0530
committerAbhishek Yadav <zerothabhishek@gmail.com>2016-01-20 07:57:30 +0530
commite362c31b342927361f3e81f36d12e245bca624c2 (patch)
treeef83bd56c8c84fd65403b04f6c611b7b9556cb3d /actionpack/test/controller
parentfe55163f111bb20309f20c4d18959bd6aacb41af (diff)
downloadrails-e362c31b342927361f3e81f36d12e245bca624c2.tar.gz
rails-e362c31b342927361f3e81f36d12e245bca624c2.tar.bz2
rails-e362c31b342927361f3e81f36d12e245bca624c2.zip
Response etags to always be weak: Prefixed W/ to value returned by ActionDispatch::Http::Cache::Response#etag= such that etags set in fresh_when and stale? are weak. For #17556.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/live_stream_test.rb2
-rw-r--r--actionpack/test/controller/render_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb
index aab2d9545d..2ef9734269 100644
--- a/actionpack/test/controller/live_stream_test.rb
+++ b/actionpack/test/controller/live_stream_test.rb
@@ -429,7 +429,7 @@ module ActionController
end
def test_stale_with_etag
- @request.if_none_match = Digest::MD5.hexdigest("123")
+ @request.if_none_match = %(W/"#{Digest::MD5.hexdigest('123')}")
get :with_stale
assert_equal 304, response.status.to_i
end
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 256ebf6a07..990e5813a8 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -461,7 +461,7 @@ class EtagRenderTest < ActionController::TestCase
end
def etag(record)
- Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key(record)).inspect
+ %(W/"#{Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key(record))}")
end
end