diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-05-02 07:38:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-05-02 07:38:04 +0000 |
commit | 61776a8b7e60e2a794080b8d2b72c707086adfd8 (patch) | |
tree | 0ebacc25135a05a35ea06ffb6f0e110bc538fcbe /test/unit/attachment_test.rb | |
parent | 382ca5055a3a28726b5b66cb79856fbeaaaf73e9 (diff) | |
download | redmine-61776a8b7e60e2a794080b8d2b72c707086adfd8.tar.gz redmine-61776a8b7e60e2a794080b8d2b72c707086adfd8.zip |
Blank content type for attachments attached via Ajax file upload (Patch by Jens Krämer).
git-svn-id: http://svn.redmine.org/redmine/trunk@13125 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/attachment_test.rb')
-rw-r--r-- | test/unit/attachment_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb index 47992299e..6a077fcc2 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -241,6 +241,15 @@ class AttachmentTest < ActiveSupport::TestCase end end + test "Attachment.attach_files should preserve the content_type of attachments added by token" do + @project = Project.find(1) + attachment = Attachment.create!(:file => uploaded_test_file("testfile.txt", ""), :author_id => 1, :created_on => 2.days.ago) + assert_equal 'text/plain', attachment.content_type + Attachment.attach_files(@project, { '1' => {'token' => attachment.token } }) + attachment.reload + assert_equal 'text/plain', attachment.content_type + end + def test_latest_attach set_fixtures_attachments_directory a1 = Attachment.find(16) |