Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/bitbucket_import/importers/pull_request_importer_spec.rb')
-rw-r--r--spec/lib/gitlab/bitbucket_import/importers/pull_request_importer_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/bitbucket_import/importers/pull_request_importer_spec.rb b/spec/lib/gitlab/bitbucket_import/importers/pull_request_importer_spec.rb
index 1f36a353724..e5a8a1c906f 100644
--- a/spec/lib/gitlab/bitbucket_import/importers/pull_request_importer_spec.rb
+++ b/spec/lib/gitlab/bitbucket_import/importers/pull_request_importer_spec.rb
@@ -77,6 +77,18 @@ RSpec.describe Gitlab::BitbucketImport::Importers::PullRequestImporter, :clean_g
end
end
+ context 'when the source and target projects are different' do
+ let(:importer) { described_class.new(project, hash.merge(source_and_target_project_different: true)) }
+
+ it 'skips the import' do
+ expect(Gitlab::BitbucketImport::Logger)
+ .to receive(:info)
+ .with(include(message: 'skipping because source and target projects are different', iid: anything))
+
+ expect { importer.execute }.not_to change { project.merge_requests.count }
+ end
+ end
+
context 'when the author does not have a bitbucket identity' do
before do
identity.update!(provider: :github)