aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/caching_test.rb
diff options
context:
space:
mode:
authorMislav Marohnić <mislav.marohnic@gmail.com>2009-03-11 00:02:08 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-03-10 23:31:19 +0000
commitfa45540cdb30cee44983c9121e3ebfc317d21668 (patch)
tree82d3b6d6f763b2f34774d22d581ee1a620e093f2 /actionpack/test/controller/caching_test.rb
parentea0e41d8fa5a132a2d2771e9785833b7663203ac (diff)
downloadrails-fa45540cdb30cee44983c9121e3ebfc317d21668.tar.gz
rails-fa45540cdb30cee44983c9121e3ebfc317d21668.tar.bz2
rails-fa45540cdb30cee44983c9121e3ebfc317d21668.zip
Ensure correct content type is declared after cache hits on actions with string cache keys [#1585 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r--actionpack/test/controller/caching_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 9af1ccc740..86dafd9221 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -428,6 +428,20 @@ class ActionCacheTest < ActionController::TestCase
assert_equal 'application/xml', @response.content_type
end
+ def test_correct_content_type_is_returned_for_cache_hit_on_action_with_string_key
+ # run it twice to cache it the first time
+ get :show, :format => 'xml'
+ get :show, :format => 'xml'
+ assert_equal 'application/xml', @response.content_type
+ end
+
+ def test_correct_content_type_is_returned_for_cache_hit_on_action_with_string_key_from_proc
+ # run it twice to cache it the first time
+ get :edit, :id => 1, :format => 'xml'
+ get :edit, :id => 1, :format => 'xml'
+ assert_equal 'application/xml', @response.content_type
+ end
+
def test_empty_path_is_normalized
@mock_controller.mock_url_for = 'http://example.org/'
@mock_controller.mock_path = '/'