aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-10-01 23:03:54 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2015-10-01 23:03:54 +0200
commit2c41b530b161e4974b336e8150b8b2ef475c56fe (patch)
tree45a2a8514faed066ee9f65e62298c3cfa6f5f4c8 /actionpack/test
parent62c82f7ddf0b50aae98a13236bc3ab88c3942d4d (diff)
parentd87427c6c75c4d8573ea77a7447c6ab1a3dcde9d (diff)
downloadrails-2c41b530b161e4974b336e8150b8b2ef475c56fe.tar.gz
rails-2c41b530b161e4974b336e8150b8b2ef475c56fe.tar.bz2
rails-2c41b530b161e4974b336e8150b8b2ef475c56fe.zip
Merge pull request #21757 from Gaurav2728/gaurav-adding_x_frame_test
adding test for content type with default charset
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/response_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 85cdcda655..fa29f3a6c4 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -196,7 +196,17 @@ class ResponseTest < ActiveSupport::TestCase
assert_equal('application/xml; charset=utf-16', resp.headers['Content-Type'])
end
- test "read content type without charset" do
+ test "read content type with default charset utf-8" do
+ original = ActionDispatch::Response.default_charset
+ begin
+ resp = ActionDispatch::Response.new(200, { "Content-Type" => "text/xml" })
+ assert_equal('utf-8', resp.charset)
+ ensure
+ ActionDispatch::Response.default_charset = original
+ end
+ end
+
+ test "read content type with charset utf-16" do
jruby_skip "https://github.com/jruby/jruby/issues/3138"
original = ActionDispatch::Response.default_charset