1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

ensure that content type defaults to text / html when setting charset

This commit is contained in:
Aaron Patterson 2015-09-08 15:37:33 -07:00
parent cd8eb351fb
commit f9ff4e591e

View file

@ -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*")