mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adding test for content type with default charset
* first test is for `default_charset` i.e `ActionDispatch::Response.default_charset = “utf-8”` * In below test we are passing `ActionDispatch::Response.default_charset = 'utf-16’` so name of the test is irrelevant — “read content type without charset”
This commit is contained in:
parent
62c82f7ddf
commit
d87427c6c7
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue