aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-12-31 07:23:36 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2012-12-31 07:23:36 -0800
commit5e5107430bccc0a536e0b264c951793d8fe62235 (patch)
tree737db392cb78d5afa407d56cacd00e38551172cb /actionpack/test
parent2b773e148b56e0cff3b07ef1902311688fb9fed8 (diff)
parentb8c2f3c7692867dfd444d60efb18570ad0fba236 (diff)
downloadrails-5e5107430bccc0a536e0b264c951793d8fe62235.tar.gz
rails-5e5107430bccc0a536e0b264c951793d8fe62235.tar.bz2
rails-5e5107430bccc0a536e0b264c951793d8fe62235.zip
Merge pull request #8662 from senny/8661_should_not_append_charset_if_already_present
Charset should not be appended to image/* type
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 6d91415e4f..c7a66f4298 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