Actions
Defect #28440
closedAfter commit missing file
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Duplicate
Affected version:
Description
--- a/test/unit/attachment_transaction_test.rb +++ b/test/unit/attachment_transaction_test.rb @@ -73,4 +73,18 @@ class AttachmentTest < ActiveSupport::TestCase end assert File.exist?(diskfile) end + + def test_after_commit_dont_missing_file + attachments = + ActiveRecord::Base.transaction do + (1..3).map do + Attachment.create!( + :file => 'anything', + :filename => 'filename.pdf', + :author => User.find(1) + ) + end + end + assert attachments.reject { |a| File.exist?(a.diskfile) }.empty? + end end
Related issues
Actions