diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-12-30 22:49:46 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2012-12-31 16:08:36 +0100 |
commit | b8c2f3c7692867dfd444d60efb18570ad0fba236 (patch) | |
tree | 378ec5d160a0fdaf2d75cb8f372061d88813ba6b /actionpack/test/controller | |
parent | 1304298bd921976b8390a8d90bb533fd493e2867 (diff) | |
download | rails-b8c2f3c7692867dfd444d60efb18570ad0fba236.tar.gz rails-b8c2f3c7692867dfd444d60efb18570ad0fba236.tar.bz2 rails-b8c2f3c7692867dfd444d60efb18570ad0fba236.zip |
charset should not be appended for `head` responses
1) Failure:
test_head_created_with_image_png_content_type(RenderTest) [test/controller/render_test.rb:1238]:
Expected: "image/png"
Actual: "image/png; charset=utf-8"
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 7640bc12a2..b5b5eadd7b 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -531,6 +531,10 @@ class TestController < ActionController::Base head :created, :content_type => "application/json" end + def head_ok_with_image_png_content_type + head :ok, :content_type => "image/png" + end + def head_with_location_header head :location => "/foo" end @@ -1224,10 +1228,17 @@ class RenderTest < ActionController::TestCase def test_head_created_with_application_json_content_type post :head_created_with_application_json_content_type assert_blank @response.body - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.header["Content-Type"] assert_response :created end + def test_head_ok_with_image_png_content_type + post :head_ok_with_image_png_content_type + assert_blank @response.body + assert_equal "image/png", @response.header["Content-Type"] + assert_response :ok + end + def test_head_with_location_header get :head_with_location_header assert_blank @response.body |