summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-21 21:02:38 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-21 21:02:38 +0000
commit64763bece35c76f611ceaedd243aa93cb1358344 (patch)
tree680cca7eb4878806e908442be906ec7517461f59 /test/integration
parentb8a586c4750f963e0681903d2d03f309ddb8d497 (diff)
downloadredmine-64763bece35c76f611ceaedd243aa93cb1358344.tar.gz
redmine-64763bece35c76f611ceaedd243aa93cb1358344.zip
Attachment content type not set when uploading attachment (#18667).
git-svn-id: http://svn.redmine.org/redmine/trunk@13787 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/attachments_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/integration/attachments_test.rb b/test/integration/attachments_test.rb
index 47577cbd0..646382a42 100644
--- a/test/integration/attachments_test.rb
+++ b/test/integration/attachments_test.rb
@@ -23,6 +23,16 @@ class AttachmentsTest < Redmine::IntegrationTest
:trackers, :projects_trackers,
:issue_statuses, :enumerations
+ def test_upload_should_set_default_content_type
+ log_user('jsmith', 'jsmith')
+ assert_difference 'Attachment.count' do
+ post "/uploads.js?attachment_id=1&filename=foo.txt", "File content", {"CONTENT_TYPE" => 'application/octet-stream'}
+ assert_response :success
+ end
+ attachment = Attachment.order(:id => :desc).first
+ assert_equal 'text/plain', attachment.content_type
+ end
+
def test_upload_as_js_and_attach_to_an_issue
log_user('jsmith', 'jsmith')