summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-03-19 21:09:49 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-03-20 21:00:32 +0000
commit3c764b18b533e57c1d9f0afa62a7cbf8c2b12120 (patch)
treeef85b5bbbfd1da3b49e353572e69f5862215aeb4 /spec
parenta3473b4cd5dfe84cc34fc9b50b9a1838e04bb377 (diff)
downloadgitlab-ce-3c764b18b533e57c1d9f0afa62a7cbf8c2b12120.tar.gz
Merge branch 'sh-create-branch-as-project-owner-for-github-import' into 'master'
GitHub import: Create new branches as project owner See merge request gitlab-org/gitlab-ce!26335 (cherry picked from commit 6e74eb4eacdc9dbb4ce584fc8ae2e151a911e17b) 1e6ea914 GitHub import: Create new branches as project owner
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
index 15e59718dce..37c3fae7cb7 100644
--- a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
@@ -273,6 +273,11 @@ describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redi
mr.state = 'opened'
mr.save
+ # Ensure the project owner is creating the branches because the
+ # merge request author may not have access to push to this
+ # repository.
+ allow(project.repository).to receive(:add_branch).with(project.owner, anything, anything).and_call_original
+
importer.insert_git_data(mr, exists)
expect(project.repository.branch_exists?(mr.source_branch)).to be_truthy