summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/migrations/track_untracked_uploads_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/migrations/track_untracked_uploads_spec.rb b/spec/migrations/track_untracked_uploads_spec.rb
index 9fa586ff177..c9bbc09cc49 100644
--- a/spec/migrations/track_untracked_uploads_spec.rb
+++ b/spec/migrations/track_untracked_uploads_spec.rb
@@ -5,6 +5,7 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
include TrackUntrackedUploadsHelpers
let(:untracked_files_for_uploads) { table(:untracked_files_for_uploads) }
+ let(:uploads) { table(:uploads) }
matcher :be_scheduled_migration do
match do |migration|
@@ -33,7 +34,6 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
let!(:user2) { create(:user, :with_avatar) }
let!(:project1) { create(:project, :with_avatar) }
let!(:project2) { create(:project, :with_avatar) }
- let(:uploads) { table(:uploads) }
before do
UploadService.new(project1, uploaded_file, FileUploader).execute # Markdown upload
@@ -90,4 +90,12 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
expect(table_exists?(:untracked_files_for_uploads)).to be_falsey
end
end
+
+ context 'without any uploads ever' do
+ it 'does not add any upload records' do
+ expect do
+ migrate!
+ end.not_to change { uploads.count }.from(0)
+ end
+ end
end