aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorAndrey Glushkov <aglushkov@shakuro.com>2019-02-25 21:25:13 +0300
committerAndrey Glushkov <aglushkov@shakuro.com>2019-02-25 21:25:13 +0300
commit12c6e7b300d312fbaa6fd2d2d546419ff67bf910 (patch)
treedae51b7ddcd3451cb510fa2d166e936a56552d9c /actionpack/test/dispatch
parent4ea067017ae52d4a74335ed85df085a86663d213 (diff)
downloadrails-12c6e7b300d312fbaa6fd2d2d546419ff67bf910.tar.gz
rails-12c6e7b300d312fbaa6fd2d2d546419ff67bf910.tar.bz2
rails-12c6e7b300d312fbaa6fd2d2d546419ff67bf910.zip
Allow custom cache-control header in AC::Live
https://github.com/rails/rails/issues/35312
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/live_response_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/live_response_test.rb b/actionpack/test/dispatch/live_response_test.rb
index b673fd3805..f2459112b2 100644
--- a/actionpack/test/dispatch/live_response_test.rb
+++ b/actionpack/test/dispatch/live_response_test.rb
@@ -51,11 +51,17 @@ module ActionController
assert_equal ["omg"], @response.body_parts
end
- def test_cache_control_is_set
+ def test_cache_control_is_set_by_default
@response.stream.write "omg"
assert_equal "no-cache", @response.headers["Cache-Control"]
end
+ def test_cache_control_is_set_manually
+ @response.set_header("Cache-Control", "public")
+ @response.stream.write "omg"
+ assert_equal "public", @response.headers["Cache-Control"]
+ end
+
def test_content_length_is_removed
@response.headers["Content-Length"] = "1234"
@response.stream.write "omg"