diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-29 11:05:05 -0400 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-29 11:05:05 -0400 |
commit | ef10679418f6fca1a0bb8c0f5d57c1550e104183 (patch) | |
tree | 76f063d2ff97fde377c865abdb365cb1f61da688 /spec/tasks | |
parent | c88fe5a31be4d14bf7efbc7ab8aa763678b17967 (diff) | |
download | gitlab-ce-ef10679418f6fca1a0bb8c0f5d57c1550e104183.tar.gz |
fix rake migration task from ignoring Upload(store: nil)
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/uploads/migrate_rake_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/tasks/gitlab/uploads/migrate_rake_spec.rb b/spec/tasks/gitlab/uploads/migrate_rake_spec.rb index b778d26060d..8f93ffa0edd 100644 --- a/spec/tasks/gitlab/uploads/migrate_rake_spec.rb +++ b/spec/tasks/gitlab/uploads/migrate_rake_spec.rb @@ -20,9 +20,20 @@ describe 'gitlab:uploads:migrate rake tasks' do run_rake_task("gitlab:uploads:migrate", *args) end - it 'enqueue jobs in batch' do - expect(ObjectStorage::MigrateUploadsWorker).to receive(:enqueue!).exactly(4).times + shared_examples 'enqueue jobs in batch' do |batch:| + it do + expect(ObjectStorage::MigrateUploadsWorker) + .to receive(:enqueue!).exactly(batch).times - run + run + end + end + + context 'Upload has store = nil' do + before do + Upload.where(model: projects.first(5)).update_all(store: nil) + end + + it_behaves_like 'enqueue jobs in batch', batch: 4 end end |