diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-08 15:37:33 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-08 16:14:41 -0700 |
commit | f9ff4e591ec7052f3f95f61885877fc09e6b77e8 (patch) | |
tree | 9450817aa8263b6961c4bf75a97f4c7924930b2f | |
parent | cd8eb351fb514a0e7225cb548e5eec082a0b495e (diff) | |
download | rails-f9ff4e591ec7052f3f95f61885877fc09e6b77e8.tar.gz rails-f9ff4e591ec7052f3f95f61885877fc09e6b77e8.tar.bz2 rails-f9ff4e591ec7052f3f95f61885877fc09e6b77e8.zip |
ensure that content type defaults to text / html when setting charset
-rw-r--r-- | actionpack/test/dispatch/response_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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*") |