From 0b04de0a23e2b9ce991cb06d2a1788ef0cc834cf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 19 Feb 2015 17:46:24 +0000 Subject: Send a better content type than application/octet-stream (#19131). git-svn-id: http://svn.redmine.org/redmine/trunk@14034 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/attachments_controller_test.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/functional') diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index efd537599..5174c8da1 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -192,7 +192,7 @@ class AttachmentsControllerTest < ActionController::TestCase def test_show_other get :show, :id => 6 assert_response :success - assert_equal 'application/octet-stream', @response.content_type + assert_equal 'application/zip', @response.content_type set_tmp_attachments_directory end @@ -262,6 +262,15 @@ class AttachmentsControllerTest < ActionController::TestCase set_tmp_attachments_directory end + def test_download_should_assign_better_content_type_than_application_octet_stream + Attachment.find(4).update! :content_type => "application/octet-stream" + + get :download, :id => 4 + assert_response :success + assert_equal 'text/x-ruby', @response.content_type + set_tmp_attachments_directory + end + def test_download_missing_file get :download, :id => 2 assert_response 404 -- cgit v1.2.3