aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/send_file_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-08-29 15:23:04 -0700
committerGitHub <noreply@github.com>2016-08-29 15:23:04 -0700
commit6949f8e5e7dc901d4e04ebab6c975afb33ca44c9 (patch)
treeaacd1d261e7e5d884d81a84c1c814c8a903ad287 /actionpack/test/controller/send_file_test.rb
parent3fc414a019526e5584867b032a188adf15c71eac (diff)
parent92f8b99ff74cee43f56ff336838b3a776e763136 (diff)
downloadrails-6949f8e5e7dc901d4e04ebab6c975afb33ca44c9.tar.gz
rails-6949f8e5e7dc901d4e04ebab6c975afb33ca44c9.tar.bz2
rails-6949f8e5e7dc901d4e04ebab6c975afb33ca44c9.zip
Merge pull request #26317 from maclover7/jm-fix-26298
Allow `send_file` to declare a charset
Diffstat (limited to 'actionpack/test/controller/send_file_test.rb')
-rw-r--r--actionpack/test/controller/send_file_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index 25420ead3b..8dc565ac8d 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -233,4 +233,18 @@ class SendFileTest < ActionController::TestCase
response = process("file")
assert_equal 200, response.status
end
+
+ def test_send_file_charset_with_type_options_key
+ @controller = SendFileWithActionControllerLive.new
+ @controller.options = { type: "text/calendar; charset=utf-8" }
+ response = process("file")
+ assert_equal "text/calendar; charset=utf-8", response.headers["Content-Type"]
+ end
+
+ def test_send_file_charset_with_content_type_options_key
+ @controller = SendFileWithActionControllerLive.new
+ @controller.options = { content_type: "text/calendar" }
+ response = process("file")
+ assert_equal "text/calendar; charset=utf-8", response.headers["Content-Type"]
+ end
end