diff options
Diffstat (limited to 'spec/support/shared_examples/tasks/gitlab/uploads/migration_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/tasks/gitlab/uploads/migration_shared_examples.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/spec/support/shared_examples/tasks/gitlab/uploads/migration_shared_examples.rb b/spec/support/shared_examples/tasks/gitlab/uploads/migration_shared_examples.rb deleted file mode 100644 index b37a8059574..00000000000 --- a/spec/support/shared_examples/tasks/gitlab/uploads/migration_shared_examples.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -# Expects the calling spec to define: -# - uploader_class -# - model_class -# - mounted_as -RSpec.shared_examples 'enqueue upload migration jobs in batch' do |batch:| - def run(task) - args = [uploader_class.to_s, model_class.to_s, mounted_as].compact - run_rake_task(task, *args) - end - - it 'migrates local storage to remote object storage' do - expect(ObjectStorage::MigrateUploadsWorker) - .to receive(:perform_async).exactly(batch).times - .and_return("A fake job.") - - run('gitlab:uploads:migrate') - end - - it 'migrates remote object storage to local storage' do - expect(Upload).to receive(:where).exactly(batch + 1).times { Upload.all } - expect(ObjectStorage::MigrateUploadsWorker) - .to receive(:perform_async) - .with(anything, model_class.name, mounted_as, ObjectStorage::Store::LOCAL) - .exactly(batch).times - .and_return("A fake job.") - - run('gitlab:uploads:migrate_to_local') - end -end |