summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-12-05 10:43:08 -0800
committerMichael Kozono <mkozono@gmail.com>2017-12-05 11:19:23 -0800
commit77be7efcf58e0c6cf7a16c249161c0c791c545e1 (patch)
treeeea0f90eed52e7dbc07b08dceaa85f8cfc9ac2b6
parent602f6bc89c9464fabab827b833133439af26a3c4 (diff)
downloadgitlab-ce-77be7efcf58e0c6cf7a16c249161c0c791c545e1.tar.gz
Guarantee all IDs are included
-rw-r--r--spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
index 7c69755c4cf..35ea8059510 100644
--- a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
+++ b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
@@ -46,7 +46,7 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
it 'adds untracked files to the uploads table' do
expect do
- subject.perform(1, 1000)
+ subject.perform(1, untracked_files_for_uploads.last.id)
end.to change { uploads.count }.from(4).to(8)
expect(user2.uploads.count).to eq(1)
@@ -58,12 +58,12 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
expect(subject).to receive(:drop_temp_table_if_finished) # Don't drop the table so we can look at it
expect do
- subject.perform(1, 1000)
+ subject.perform(1, untracked_files_for_uploads.last.id)
end.to change { untracked_files_for_uploads.count }.from(8).to(0)
end
it 'does not create duplicate uploads of already tracked files' do
- subject.perform(1, 1000)
+ subject.perform(1, untracked_files_for_uploads.last.id)
expect(user1.uploads.count).to eq(1)
expect(project1.uploads.count).to eq(2)
@@ -140,7 +140,7 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
it 'creates an Upload record' do
expect do
- subject.perform(1, 1000)
+ subject.perform(1, untracked_files_for_uploads.last.id)
end.to change { model.reload.uploads.count }.from(0).to(1)
expect(model.uploads.first.attributes).to include(expected_upload_attrs)
@@ -206,7 +206,7 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
it 'creates an Upload record' do
expect do
- subject.perform(1, 1000)
+ subject.perform(1, untracked_files_for_uploads.last.id)
end.to change { model.reload.uploads.count }.from(0).to(1)
expect(model.uploads.first.attributes).to include(@expected_upload_attrs)