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/tasks')
-rw-r--r--spec/tasks/gitlab/uploads/migrate_rake_spec.rb17
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