Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r--spec/models/note_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 4eabc266b40..d9f566f9383 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -1522,4 +1522,16 @@ RSpec.describe Note do
it { is_expected.to be_truthy }
end
end
+
+ describe '#attachment' do
+ it 'is cleaned up correctly when project is destroyed' do
+ note = create(:note_on_issue, :with_attachment)
+
+ attachment = note.attachment
+
+ note.project.destroy!
+
+ expect(attachment).not_to be_exist
+ end
+ end
end