diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/lib/gitlab/import_export/importer_spec.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/lib/gitlab/import_export/importer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/importer_spec.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/lib/gitlab/import_export/importer_spec.rb b/spec/lib/gitlab/import_export/importer_spec.rb index 0db038785d3..75db3167ebc 100644 --- a/spec/lib/gitlab/import_export/importer_spec.rb +++ b/spec/lib/gitlab/import_export/importer_spec.rb @@ -48,7 +48,6 @@ RSpec.describe Gitlab::ImportExport::Importer do [ Gitlab::ImportExport::AvatarRestorer, Gitlab::ImportExport::RepoRestorer, - Gitlab::ImportExport::WikiRestorer, Gitlab::ImportExport::UploadsRestorer, Gitlab::ImportExport::LfsRestorer, Gitlab::ImportExport::StatisticsRestorer, @@ -65,6 +64,20 @@ RSpec.describe Gitlab::ImportExport::Importer do end end + it 'calls RepoRestorer with project and wiki' do + wiki_repo_path = File.join(shared.export_path, Gitlab::ImportExport.wiki_repo_bundle_filename) + repo_path = File.join(shared.export_path, Gitlab::ImportExport.project_bundle_filename) + restorer = double(Gitlab::ImportExport::RepoRestorer) + + expect(Gitlab::ImportExport::RepoRestorer).to receive(:new).with(path_to_bundle: repo_path, shared: shared, project: project).and_return(restorer) + expect(Gitlab::ImportExport::RepoRestorer).to receive(:new).with(path_to_bundle: wiki_repo_path, shared: shared, project: ProjectWiki.new(project)).and_return(restorer) + expect(Gitlab::ImportExport::RepoRestorer).to receive(:new).and_call_original + + expect(restorer).to receive(:restore).and_return(true).twice + + importer.execute + end + context 'with sample_data_template' do it 'initializes the Sample::TreeRestorer' do project.create_or_update_import_data(data: { sample_data: true }) |