aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/response_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-09-08 15:37:33 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-09-08 16:14:41 -0700
commitf9ff4e591ec7052f3f95f61885877fc09e6b77e8 (patch)
tree9450817aa8263b6961c4bf75a97f4c7924930b2f /actionpack/test/dispatch/response_test.rb
parentcd8eb351fb514a0e7225cb548e5eec082a0b495e (diff)
downloadrails-f9ff4e591ec7052f3f95f61885877fc09e6b77e8.tar.gz
rails-f9ff4e591ec7052f3f95f61885877fc09e6b77e8.tar.bz2
rails-f9ff4e591ec7052f3f95f61885877fc09e6b77e8.zip
ensure that content type defaults to text / html when setting charset
Diffstat (limited to 'actionpack/test/dispatch/response_test.rb')
-rw-r--r--actionpack/test/dispatch/response_test.rb7
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*")