diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /spec/lib/gitlab/import_export/file_importer_spec.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'spec/lib/gitlab/import_export/file_importer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/file_importer_spec.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/lib/gitlab/import_export/file_importer_spec.rb b/spec/lib/gitlab/import_export/file_importer_spec.rb index ed4436b7257..7b27f7183b0 100644 --- a/spec/lib/gitlab/import_export/file_importer_spec.rb +++ b/spec/lib/gitlab/import_export/file_importer_spec.rb @@ -72,6 +72,25 @@ RSpec.describe Gitlab::ImportExport::FileImporter do expect(shared.export_path).to include('test/abcd') end + context 'when the import file is not remote' do + include AfterNextHelpers + + it 'downloads the file from a remote object storage' do + import_export_upload = build(:import_export_upload) + project = build( :project, import_export_upload: import_export_upload) + + expect_next(described_class) + .to receive(:download_or_copy_upload) + .with( + import_export_upload.import_file, + kind_of(String), + size_limit: ::Import::GitlabProjects::RemoteFileValidator::FILE_SIZE_LIMIT + ) + + described_class.import(importable: project, archive_file: nil, shared: shared) + end + end + context 'when the import file is remote' do include AfterNextHelpers @@ -82,7 +101,11 @@ RSpec.describe Gitlab::ImportExport::FileImporter do expect_next(described_class) .to receive(:download) - .with(file_url, kind_of(String)) + .with( + file_url, + kind_of(String), + size_limit: ::Import::GitlabProjects::RemoteFileValidator::FILE_SIZE_LIMIT + ) described_class.import(importable: project, archive_file: nil, shared: shared) end |