From f9ff4e591ec7052f3f95f61885877fc09e6b77e8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 8 Sep 2015 15:37:33 -0700 Subject: ensure that content type defaults to text / html when setting charset --- actionpack/test/dispatch/response_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test/dispatch/response_test.rb') diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb index 780e7dc3e2..3f758c31cc 100644 --- a/actionpack/test/dispatch/response_test.rb +++ b/actionpack/test/dispatch/response_test.rb @@ -67,6 +67,13 @@ class ResponseTest < ActiveSupport::TestCase assert_equal 200, ActionDispatch::Response.new('200 OK').status end + def test_only_set_charset_still_defaults_to_text_html + response = ActionDispatch::Response.new + response.charset = "utf-16" + _,headers,_ = response.to_a + assert_equal "text/html; charset=utf-16", headers['Content-Type'] + end + test "utf8 output" do @response.body = [1090, 1077, 1089, 1090].pack("U*") -- cgit v1.2.3