Commit 0af2c02e authored by Kassio Borges's avatar Kassio Borges

Project Import: Fix remote file download

A typo was introduced in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59033, which
pointed the download to the wrong variable.

Changelog: fixed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61376
parent db328436
......@@ -74,7 +74,7 @@ module Gitlab
import_export_upload = @importable.import_export_upload
if import_export_upload.remote_import_url.present?
download(remote_import_url, @archive_file)
download(import_export_upload.remote_import_url, @archive_file)
else
download_or_copy_upload(import_export_upload.import_file, @archive_file)
end
......
......@@ -71,6 +71,22 @@ RSpec.describe Gitlab::ImportExport::FileImporter do
it 'creates the file in the right subfolder' do
expect(shared.export_path).to include('test/abcd')
end
context 'when the import file is remote' do
include AfterNextHelpers
it 'downloads the file from a remote object storage' do
file_url = 'https://remote.url/file'
import_export_upload = build(:import_export_upload, remote_import_url: file_url)
project = build( :project, import_export_upload: import_export_upload)
expect_next(described_class)
.to receive(:download)
.with(file_url, kind_of(String))
described_class.import(importable: project, archive_file: nil, shared: shared)
end
end
end
context 'error' 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