diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-11-24 00:49:04 -0800 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-12-01 15:26:42 -0800 |
commit | 473ddfb453d820f1a32fb48477e17ba45bdbd2f0 (patch) | |
tree | aa64312ad413539aec7e0091e143b25628a313c0 /spec/migrations | |
parent | 61a73cadb7f21de9f863fc1a16f13880861ac9f4 (diff) | |
download | gitlab-ce-473ddfb453d820f1a32fb48477e17ba45bdbd2f0.tar.gz |
Don’t recreate deleted uploads
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/track_untracked_uploads_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/migrations/track_untracked_uploads_spec.rb b/spec/migrations/track_untracked_uploads_spec.rb index 01bfe26744f..9fa586ff177 100644 --- a/spec/migrations/track_untracked_uploads_spec.rb +++ b/spec/migrations/track_untracked_uploads_spec.rb @@ -75,6 +75,15 @@ describe TrackUntrackedUploads, :migration, :sidekiq do expect(project1.uploads.where(uploader: 'FileUploader').first.attributes).to include(@project1_markdown_attributes) end + it 'ignores uploads for deleted models' do + user2.destroy + project2.destroy + + expect do + migrate! + end.to change { uploads.count }.from(4).to(5) + end + it 'the temporary table untracked_files_for_uploads no longer exists' do migrate! |