From 9ef7fa684bada2b5f69f2d90c704fac88fea95f9 Mon Sep 17 00:00:00 2001 From: Denis Odorcic Date: Sun, 14 Mar 2010 06:19:04 -0400 Subject: [PATCH] Test for expires_now properly setting Cache-Control to 'no-cache' --- actionpack/test/controller/render_test.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 112e9ef..8582a1a 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -69,6 +69,11 @@ class TestController < ActionController::Base expires_in 1.minute, :public => true, :private => nil, 'max-stale' => 5.hours render :action => 'hello_world' end + + def conditional_hello_with_expires_now + expires_now + render :action => 'hello_world' + end def conditional_hello_with_bangs render :action => 'hello_world' @@ -1577,6 +1582,11 @@ class ExpiresInRenderTest < ActionController::TestCase get :conditional_hello_with_expires_in_with_public_with_more_keys_old_syntax assert_equal "max-age=60, public, max-stale=18000", @response.headers["Cache-Control"] end + + def test_expires_in_header_with_expires_now + get :conditional_hello_with_expires_now + assert_equal "no-cache", @response.headers["Cache-Control"] + end end -- 1.6.0.6