diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-10 18:12:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-10 18:12:01 +0300 |
commit | a45283fcd27598eebd66a97041fa7d79d5a33aa5 (patch) | |
tree | a4152ef9cc78afd4596feb5d3905b0488bced2ac /spec/uploaders | |
parent | 43d1fef975a24dcaac3ad9bbf20ae9839f5ec9ed (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/uploaders')
17 files changed, 57 insertions, 57 deletions
diff --git a/spec/uploaders/attachment_uploader_spec.rb b/spec/uploaders/attachment_uploader_spec.rb index a035402e207..e4e96aa15b7 100644 --- a/spec/uploaders/attachment_uploader_spec.rb +++ b/spec/uploaders/attachment_uploader_spec.rb @@ -10,9 +10,9 @@ RSpec.describe AttachmentUploader do subject { uploader } it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/note/attachment/], - upload_path: %r[uploads/-/system/note/attachment/], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/note/attachment/] + store_dir: %r{uploads/-/system/note/attachment/}, + upload_path: %r{uploads/-/system/note/attachment/}, + absolute_path: %r{#{CarrierWave.root}/uploads/-/system/note/attachment/} context "object_store is REMOTE" do before do @@ -22,8 +22,8 @@ RSpec.describe AttachmentUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[note/attachment/], - upload_path: %r[note/attachment/] + store_dir: %r{note/attachment/}, + upload_path: %r{note/attachment/} end describe "#migrate!" do diff --git a/spec/uploaders/avatar_uploader_spec.rb b/spec/uploaders/avatar_uploader_spec.rb index bba7eb78f99..333f23d7947 100644 --- a/spec/uploaders/avatar_uploader_spec.rb +++ b/spec/uploaders/avatar_uploader_spec.rb @@ -10,9 +10,9 @@ RSpec.describe AvatarUploader do subject { uploader } it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/user/avatar/], - upload_path: %r[uploads/-/system/user/avatar/], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/user/avatar/] + store_dir: %r{uploads/-/system/user/avatar/}, + upload_path: %r{uploads/-/system/user/avatar/}, + absolute_path: %r{#{CarrierWave.root}/uploads/-/system/user/avatar/} context "object_store is REMOTE" do before do @@ -22,8 +22,8 @@ RSpec.describe AvatarUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[user/avatar/], - upload_path: %r[user/avatar/] + store_dir: %r{user/avatar/}, + upload_path: %r{user/avatar/} end context "with a file" do diff --git a/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb b/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb index 3935f081372..ace7bcbce48 100644 --- a/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb +++ b/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb @@ -10,8 +10,8 @@ RSpec.describe Ci::PipelineArtifactUploader do it_behaves_like "builds correct paths", store_dir: %r[\h{2}/\h{2}/\h{64}/pipelines/\d+/artifacts/\d+], - cache_dir: %r[artifacts/tmp/cache], - work_dir: %r[artifacts/tmp/work] + cache_dir: %r{artifacts/tmp/cache}, + work_dir: %r{artifacts/tmp/work} context 'when object store is REMOTE' do before do diff --git a/spec/uploaders/dependency_proxy/file_uploader_spec.rb b/spec/uploaders/dependency_proxy/file_uploader_spec.rb index 3cb2d1ea0f0..faaa5541f0b 100644 --- a/spec/uploaders/dependency_proxy/file_uploader_spec.rb +++ b/spec/uploaders/dependency_proxy/file_uploader_spec.rb @@ -12,8 +12,8 @@ RSpec.describe DependencyProxy::FileUploader do it_behaves_like "builds correct paths", store_dir: %r[\h{2}/\h{2}], - cache_dir: %r[/dependency_proxy/tmp/cache], - work_dir: %r[/dependency_proxy/tmp/work] + cache_dir: %r{/dependency_proxy/tmp/cache}, + work_dir: %r{/dependency_proxy/tmp/work} context 'object store is remote' do before do diff --git a/spec/uploaders/design_management/design_v432x230_uploader_spec.rb b/spec/uploaders/design_management/design_v432x230_uploader_spec.rb index 3991058b32d..edfab24331c 100644 --- a/spec/uploaders/design_management/design_v432x230_uploader_spec.rb +++ b/spec/uploaders/design_management/design_v432x230_uploader_spec.rb @@ -11,10 +11,10 @@ RSpec.describe DesignManagement::DesignV432x230Uploader do subject(:uploader) { described_class.new(model, :image_v432x230) } it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/design_management/action/image_v432x230/], - upload_path: %r[uploads/-/system/design_management/action/image_v432x230/], - relative_path: %r[uploads/-/system/design_management/action/image_v432x230/], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/design_management/action/image_v432x230/] + store_dir: %r{uploads/-/system/design_management/action/image_v432x230/}, + upload_path: %r{uploads/-/system/design_management/action/image_v432x230/}, + relative_path: %r{uploads/-/system/design_management/action/image_v432x230/}, + absolute_path: %r{#{CarrierWave.root}/uploads/-/system/design_management/action/image_v432x230/} context 'object_store is REMOTE' do before do @@ -24,9 +24,9 @@ RSpec.describe DesignManagement::DesignV432x230Uploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[design_management/action/image_v432x230/], - upload_path: %r[design_management/action/image_v432x230/], - relative_path: %r[design_management/action/image_v432x230/] + store_dir: %r{design_management/action/image_v432x230/}, + upload_path: %r{design_management/action/image_v432x230/}, + relative_path: %r{design_management/action/image_v432x230/} end describe "#migrate!" do diff --git a/spec/uploaders/external_diff_uploader_spec.rb b/spec/uploaders/external_diff_uploader_spec.rb index 2121e9cbc29..25e8bd0a4dc 100644 --- a/spec/uploaders/external_diff_uploader_spec.rb +++ b/spec/uploaders/external_diff_uploader_spec.rb @@ -9,9 +9,9 @@ RSpec.describe ExternalDiffUploader do subject(:uploader) { described_class.new(diff, :external_diff) } it_behaves_like "builds correct paths", - store_dir: %r[merge_request_diffs/mr-\d+], - cache_dir: %r[/external-diffs/tmp/cache], - work_dir: %r[/external-diffs/tmp/work] + store_dir: %r{merge_request_diffs/mr-\d+}, + cache_dir: %r{/external-diffs/tmp/cache}, + work_dir: %r{/external-diffs/tmp/work} context "object store is REMOTE" do before do @@ -21,7 +21,7 @@ RSpec.describe ExternalDiffUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[merge_request_diffs/mr-\d+] + store_dir: %r{merge_request_diffs/mr-\d+} end describe 'remote file' do diff --git a/spec/uploaders/import_export_uploader_spec.rb b/spec/uploaders/import_export_uploader_spec.rb index 64e92f5d60e..1a2041df3d0 100644 --- a/spec/uploaders/import_export_uploader_spec.rb +++ b/spec/uploaders/import_export_uploader_spec.rb @@ -39,8 +39,8 @@ RSpec.describe ImportExportUploader do include_context 'with storage', described_class::Store::REMOTE patterns = { - store_dir: %r[import_export_upload/import_file/], - upload_path: %r[import_export_upload/import_file/] + store_dir: %r{import_export_upload/import_file/}, + upload_path: %r{import_export_upload/import_file/} } it_behaves_like 'builds correct paths', patterns do diff --git a/spec/uploaders/job_artifact_uploader_spec.rb b/spec/uploaders/job_artifact_uploader_spec.rb index dac9e97641d..ea4f0036fa4 100644 --- a/spec/uploaders/job_artifact_uploader_spec.rb +++ b/spec/uploaders/job_artifact_uploader_spec.rb @@ -11,8 +11,8 @@ RSpec.describe JobArtifactUploader do it_behaves_like "builds correct paths", store_dir: %r[\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z], - cache_dir: %r[artifacts/tmp/cache], - work_dir: %r[artifacts/tmp/work] + cache_dir: %r{artifacts/tmp/cache}, + work_dir: %r{artifacts/tmp/work} context "object store is REMOTE" do before do diff --git a/spec/uploaders/lfs_object_uploader_spec.rb b/spec/uploaders/lfs_object_uploader_spec.rb index 9bbfd910ada..77bde5da7ea 100644 --- a/spec/uploaders/lfs_object_uploader_spec.rb +++ b/spec/uploaders/lfs_object_uploader_spec.rb @@ -11,8 +11,8 @@ RSpec.describe LfsObjectUploader do it_behaves_like "builds correct paths", store_dir: %r[\h{2}/\h{2}], - cache_dir: %r[/lfs-objects/tmp/cache], - work_dir: %r[/lfs-objects/tmp/work] + cache_dir: %r{/lfs-objects/tmp/cache}, + work_dir: %r{/lfs-objects/tmp/work} context "object store is REMOTE" do before do diff --git a/spec/uploaders/namespace_file_uploader_spec.rb b/spec/uploaders/namespace_file_uploader_spec.rb index 02381123ba5..0db7f82dcbd 100644 --- a/spec/uploaders/namespace_file_uploader_spec.rb +++ b/spec/uploaders/namespace_file_uploader_spec.rb @@ -13,9 +13,9 @@ RSpec.describe NamespaceFileUploader do it_behaves_like 'builds correct paths' do let(:patterns) do { - store_dir: %r[uploads/-/system/namespace/\d+], + store_dir: %r{uploads/-/system/namespace/\d+}, upload_path: identifier, - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/namespace/\d+/#{identifier}] + absolute_path: %r{#{CarrierWave.root}/uploads/-/system/namespace/\d+/#{identifier}} } end end @@ -30,7 +30,7 @@ RSpec.describe NamespaceFileUploader do it_behaves_like 'builds correct paths' do let(:patterns) do { - store_dir: %r[namespace/\d+/\h+], + store_dir: %r{namespace/\d+/\h+}, upload_path: identifier } end diff --git a/spec/uploaders/object_storage_spec.rb b/spec/uploaders/object_storage_spec.rb index 576f6deeec6..e4a9b92df64 100644 --- a/spec/uploaders/object_storage_spec.rb +++ b/spec/uploaders/object_storage_spec.rb @@ -255,7 +255,7 @@ RSpec.describe ObjectStorage, :clean_gitlab_redis_shared_state, feature_category describe '#use_file' do context 'when file is stored locally' do it "calls a regular path" do - expect { |b| uploader.use_file(&b) }.not_to yield_with_args(%r[tmp/cache]) + expect { |b| uploader.use_file(&b) }.not_to yield_with_args(%r{tmp/cache}) end end @@ -267,7 +267,7 @@ RSpec.describe ObjectStorage, :clean_gitlab_redis_shared_state, feature_category end it "calls a cache path" do - expect { |b| uploader.use_file(&b) }.to yield_with_args(%r[tmp/cache]) + expect { |b| uploader.use_file(&b) }.to yield_with_args(%r{tmp/cache}) end it "cleans up the cached file" do diff --git a/spec/uploaders/packages/composer/cache_uploader_spec.rb b/spec/uploaders/packages/composer/cache_uploader_spec.rb index 7eea4a839ab..56e8b28ef36 100644 --- a/spec/uploaders/packages/composer/cache_uploader_spec.rb +++ b/spec/uploaders/packages/composer/cache_uploader_spec.rb @@ -10,8 +10,8 @@ RSpec.describe Packages::Composer::CacheUploader do it_behaves_like "builds correct paths", store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/composer_cache/\d+$], - cache_dir: %r[/packages/tmp/cache], - work_dir: %r[/packages/tmp/work] + cache_dir: %r{/packages/tmp/cache}, + work_dir: %r{/packages/tmp/work} context 'object store is remote' do before do diff --git a/spec/uploaders/packages/debian/component_file_uploader_spec.rb b/spec/uploaders/packages/debian/component_file_uploader_spec.rb index 84ba751c737..ffc5d8085fa 100644 --- a/spec/uploaders/packages/debian/component_file_uploader_spec.rb +++ b/spec/uploaders/packages/debian/component_file_uploader_spec.rb @@ -13,8 +13,8 @@ RSpec.describe Packages::Debian::ComponentFileUploader do it_behaves_like "builds correct paths", store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_component_file/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + cache_dir: %r{/packages/tmp/cache$}, + work_dir: %r{/packages/tmp/work$} context 'object store is remote' do before do @@ -25,8 +25,8 @@ RSpec.describe Packages::Debian::ComponentFileUploader do it_behaves_like "builds correct paths", store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_component_file/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + cache_dir: %r{/packages/tmp/cache$}, + work_dir: %r{/packages/tmp/work$} end describe 'remote file' do diff --git a/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb b/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb index df630569856..2086ab5966c 100644 --- a/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb +++ b/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb @@ -13,8 +13,8 @@ RSpec.describe Packages::Debian::DistributionReleaseFileUploader do it_behaves_like "builds correct paths", store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_distribution/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + cache_dir: %r{/packages/tmp/cache$}, + work_dir: %r{/packages/tmp/work$} context 'object store is remote' do before do @@ -25,8 +25,8 @@ RSpec.describe Packages::Debian::DistributionReleaseFileUploader do it_behaves_like "builds correct paths", store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_distribution/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + cache_dir: %r{/packages/tmp/cache$}, + work_dir: %r{/packages/tmp/work$} end describe 'remote file' do diff --git a/spec/uploaders/packages/package_file_uploader_spec.rb b/spec/uploaders/packages/package_file_uploader_spec.rb index ddd9823d55c..36acb681669 100644 --- a/spec/uploaders/packages/package_file_uploader_spec.rb +++ b/spec/uploaders/packages/package_file_uploader_spec.rb @@ -10,8 +10,8 @@ RSpec.describe Packages::PackageFileUploader do it_behaves_like "builds correct paths", store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/\d+/files/\d+$], - cache_dir: %r[/packages/tmp/cache], - work_dir: %r[/packages/tmp/work] + cache_dir: %r{/packages/tmp/cache}, + work_dir: %r{/packages/tmp/work} context 'object store is remote' do before do diff --git a/spec/uploaders/pages/deployment_uploader_spec.rb b/spec/uploaders/pages/deployment_uploader_spec.rb index 7686efd4fe4..a5fe2dfe9ba 100644 --- a/spec/uploaders/pages/deployment_uploader_spec.rb +++ b/spec/uploaders/pages/deployment_uploader_spec.rb @@ -14,8 +14,8 @@ RSpec.describe Pages::DeploymentUploader do it_behaves_like "builds correct paths", store_dir: %r[/\h{2}/\h{2}/\h{64}/pages_deployments/\d+], - cache_dir: %r[pages/@hashed/tmp/cache], - work_dir: %r[pages/@hashed/tmp/work] + cache_dir: %r{pages/@hashed/tmp/cache}, + work_dir: %r{pages/@hashed/tmp/work} context 'when object store is REMOTE' do before do diff --git a/spec/uploaders/personal_file_uploader_spec.rb b/spec/uploaders/personal_file_uploader_spec.rb index 58edf3f093d..de5ed8318e4 100644 --- a/spec/uploaders/personal_file_uploader_spec.rb +++ b/spec/uploaders/personal_file_uploader_spec.rb @@ -43,16 +43,16 @@ RSpec.describe PersonalFileUploader do it 'builds correct paths for both local and remote storage' do paths = uploader.upload_paths('test.jpg') - expect(paths.first).to match(%r[\h+/test.jpg]) - expect(paths.second).to match(%r[^personal_snippet/\d+/\h+/test.jpg]) + expect(paths.first).to match(%r{\h+/test.jpg}) + expect(paths.second).to match(%r{^personal_snippet/\d+/\h+/test.jpg}) end end context 'object_store is LOCAL' do it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/personal_snippet/\d+/\h+], - upload_path: %r[\h+/\S+], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/personal_snippet/\d+/\h+/\S+$] + store_dir: %r{uploads/-/system/personal_snippet/\d+/\h+}, + upload_path: %r{\h+/\S+}, + absolute_path: %r{#{CarrierWave.root}/uploads/-/system/personal_snippet/\d+/\h+/\S+$} it_behaves_like '#base_dir' it_behaves_like '#to_h' @@ -66,8 +66,8 @@ RSpec.describe PersonalFileUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[\d+/\h+], - upload_path: %r[^personal_snippet/\d+/\h+/<filename>] + store_dir: %r{\d+/\h+}, + upload_path: %r{^personal_snippet/\d+/\h+/<filename>} it_behaves_like '#base_dir' it_behaves_like '#to_h' |