diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-03 12:51:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-03 12:51:13 +0000 |
commit | 2660a2e5b361a09331ddb6a3067ddc643412769b (patch) | |
tree | 46473ccd9e5aefb4853d858ff597d8d62b704fd3 /test/unit/attachment_test.rb | |
parent | 1b81a030ce5295f522a3d7fa6b70c786a801e642 (diff) | |
download | redmine-2660a2e5b361a09331ddb6a3067ddc643412769b.tar.gz redmine-2660a2e5b361a09331ddb6a3067ddc643412769b.zip |
Adds a test for when the file comparison fails (#25215).
git-svn-id: http://svn.redmine.org/redmine/trunk@16462 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 6d988c274..acecd2b18 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -221,6 +221,15 @@ class AttachmentTest < ActiveSupport::TestCase assert_equal a1.diskfile, a2.diskfile end + def test_attachments_with_same_content_should_not_reuse_same_file_if_deleted + a1 = Attachment.create!(:container => Issue.find(1), :author => User.find(1), + :file => mock_file(:filename => 'foo', :content => 'abcd')) + a1.delete_from_disk + a2 = Attachment.create!(:container => Issue.find(1), :author => User.find(1), + :file => mock_file(:filename => 'bar', :content => 'abcd')) + assert_not_equal a1.diskfile, a2.diskfile + end + def test_attachments_with_same_filename_at_the_same_time_should_not_overwrite a1 = Attachment.create!(:container => Issue.find(1), :author => User.find(1), :file => mock_file(:filename => 'foo', :content => 'abcd')) |