diff options
author | Xavier Noria <fxn@hashref.com> | 2012-02-17 05:16:58 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-02-17 05:18:37 -0800 |
commit | ce51edb73bce5e213568fd5a362fb3557a06aee1 (patch) | |
tree | 49491604277566acfc2a5af59adf679415c76da9 /actionpack/test | |
parent | 4bb6ed7744c482dad6b71cffc19a0c86b730b730 (diff) | |
download | rails-ce51edb73bce5e213568fd5a362fb3557a06aee1.tar.gz rails-ce51edb73bce5e213568fd5a362fb3557a06aee1.tar.bz2 rails-ce51edb73bce5e213568fd5a362fb3557a06aee1.zip |
let expires_in accept a must_revalidate flag
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index fef9fbb175..c384d7c80d 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -91,6 +91,16 @@ class TestController < ActionController::Base render :action => 'hello_world' end + def conditional_hello_with_expires_in_with_must_revalidate + expires_in 1.minute, :must_revalidate => true + render :action => 'hello_world' + end + + def conditional_hello_with_expires_in_with_public_and_must_revalidate + expires_in 1.minute, :public => true, :must_revalidate => true + render :action => 'hello_world' + end + def conditional_hello_with_expires_in_with_public_with_more_keys expires_in 1.minute, :public => true, 'max-stale' => 5.hours render :action => 'hello_world' @@ -1399,6 +1409,16 @@ class ExpiresInRenderTest < ActionController::TestCase assert_equal "max-age=60, public", @response.headers["Cache-Control"] end + def test_expires_in_header_with_must_revalidate + get :conditional_hello_with_expires_in_with_must_revalidate + assert_equal "max-age=60, private, must-revalidate", @response.headers["Cache-Control"] + end + + def test_expires_in_header_with_public_and_must_revalidate + get :conditional_hello_with_expires_in_with_public_and_must_revalidate + assert_equal "max-age=60, public, must-revalidate", @response.headers["Cache-Control"] + end + def test_expires_in_header_with_additional_headers get :conditional_hello_with_expires_in_with_public_with_more_keys assert_equal "max-age=60, public, max-stale=18000", @response.headers["Cache-Control"] |