summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/lib/gitlab/import_export/project
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /spec/support/shared_examples/lib/gitlab/import_export/project
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/support/shared_examples/lib/gitlab/import_export/project')
-rw-r--r--spec/support/shared_examples/lib/gitlab/import_export/project/rake_task_object_storage_shared_examples.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/support/shared_examples/lib/gitlab/import_export/project/rake_task_object_storage_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/import_export/project/rake_task_object_storage_shared_examples.rb
new file mode 100644
index 00000000000..d6dc89a2c15
--- /dev/null
+++ b/spec/support/shared_examples/lib/gitlab/import_export/project/rake_task_object_storage_shared_examples.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'rake task with disabled object_storage' do |service_class, method|
+ it 'disables direct & background upload only for service call' do
+ expect_next_instance_of(service_class) do |service|
+ expect(service).to receive(:execute).and_wrap_original do |m|
+ expect(Settings.uploads.object_store['enabled']).to eq(false)
+
+ m.call
+ end
+ end
+
+ expect(rake_task).to receive(method).and_wrap_original do |m, *args|
+ expect(Settings.uploads.object_store['enabled']).to eq(true)
+ expect(Settings.uploads.object_store).not_to receive(:[]=).with('enabled', false)
+
+ m.call(*args)
+ end
+
+ subject
+ end
+end