Commit 74b09efc authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'mk/dry-up-package-file-stubs' into 'master'

Dry up identical stubs

See merge request gitlab-org/gitlab!37823
parents 4562e61f b10490e4
# frozen_string_literal: true
module StubObjectStorage
def stub_packages_object_storage(**params)
stub_object_storage_uploader(config: ::Gitlab.config.packages.object_store,
uploader: ::Packages::PackageFileUploader,
remote_directory: 'packages',
**params)
end
def stub_dependency_proxy_object_storage(**params)
stub_object_storage_uploader(config: ::Gitlab.config.dependency_proxy.object_store,
uploader: ::DependencyProxy::FileUploader,
......
......@@ -18,7 +18,7 @@ RSpec.describe 'gitlab:packages namespace rake task' do
context 'object storage disabled' do
before do
stub_packages_object_storage(enabled: false)
stub_package_file_object_storage(enabled: false)
end
it "doesn't migrate files" do
......@@ -28,7 +28,7 @@ RSpec.describe 'gitlab:packages namespace rake task' do
context 'object storage enabled' do
before do
stub_packages_object_storage
stub_package_file_object_storage
end
it 'migrates local file to object storage' do
......
......@@ -15,7 +15,7 @@ RSpec.describe Packages::PackageFileUploader do
context 'object store is remote' do
before do
stub_packages_object_storage
stub_package_file_object_storage
end
include_context 'with storage', described_class::Store::REMOTE
......@@ -29,7 +29,7 @@ RSpec.describe Packages::PackageFileUploader do
context 'with object storage enabled' do
before do
stub_packages_object_storage
stub_package_file_object_storage
end
it 'can store file remotely' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment