diff options
Diffstat (limited to 'actionpack/test/controller/send_file_test.rb')
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index 8dc565ac8d..9e6b975fe2 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -180,7 +180,7 @@ class SendFileTest < ActionController::TestCase "file.zip" => "application/zip", "file.unk" => "application/octet-stream", "zip" => "application/octet-stream" - }.each do |filename,expected_type| + }.each do |filename, expected_type| get __method__, params: { filename: filename } assert_equal expected_type, response.content_type end @@ -241,10 +241,17 @@ class SendFileTest < ActionController::TestCase assert_equal "text/calendar; charset=utf-8", response.headers["Content-Type"] end + def test_send_file_charset_with_type_options_key_without_charset + @controller = SendFileWithActionControllerLive.new + @controller.options = { type: "image/png" } + response = process("file") + assert_equal "image/png", 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"] + assert_equal "text/calendar", response.headers["Content-Type"] end end |