diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/support/shared_examples/bulk_imports | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/support/shared_examples/bulk_imports')
-rw-r--r-- | spec/support/shared_examples/bulk_imports/common/pipelines/wiki_pipeline_examples.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/support/shared_examples/bulk_imports/common/pipelines/wiki_pipeline_examples.rb b/spec/support/shared_examples/bulk_imports/common/pipelines/wiki_pipeline_examples.rb new file mode 100644 index 00000000000..e8cc666605b --- /dev/null +++ b/spec/support/shared_examples/bulk_imports/common/pipelines/wiki_pipeline_examples.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'wiki pipeline imports a wiki for an entity' do + describe '#run' do + let_it_be(:bulk_import_configuration) { create(:bulk_import_configuration, bulk_import: bulk_import) } + + let_it_be(:tracker) { create(:bulk_import_tracker, entity: entity) } + let_it_be(:context) { BulkImports::Pipeline::Context.new(tracker) } + + let(:extracted_data) { BulkImports::Pipeline::ExtractedData.new(data: {}) } + + context 'successfully imports wiki for an entity' do + subject { described_class.new(context) } + + before do + allow_next_instance_of(BulkImports::Common::Extractors::GraphqlExtractor) do |extractor| + allow(extractor).to receive(:extract).and_return(extracted_data) + end + end + + it 'imports new wiki into destination project' do + expect_next_instance_of(Gitlab::GitalyClient::RepositoryService) do |repository_service| + url = "https://oauth2:token@gitlab.example/#{entity.source_full_path}.wiki.git" + expect(repository_service).to receive(:fetch_remote).with(url, any_args).and_return 0 + end + + subject.run + end + end + end +end |