summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/github_import
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-03-08 19:16:39 +0100
committerGabriel Mazetto <brodock@gmail.com>2017-03-08 19:42:21 +0100
commitce35dcbc81116fa4803fc7bfcd35a3585695c07a (patch)
treeb592e7170241c676fb9b98ebb54701ec5022a51a /spec/lib/gitlab/github_import
parent4a0cf269a60945938447160a1ec0aa40889aa24d (diff)
downloadgitlab-ce-ce35dcbc81116fa4803fc7bfcd35a3585695c07a.tar.gz
Refactor some code29034-fix-github-importer
Diffstat (limited to 'spec/lib/gitlab/github_import')
-rw-r--r--spec/lib/gitlab/github_import/pull_request_formatter_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb b/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
index a469821251e..951cbea7857 100644
--- a/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
+++ b/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
@@ -281,6 +281,24 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
end
end
+ describe '#cross_project?' do
+ context 'when source and target repositories are different' do
+ let(:raw_data) { double(base_data.merge(head: forked_branch)) }
+
+ it 'returns true' do
+ expect(pull_request.cross_project?).to eq true
+ end
+ end
+
+ context 'when source and target repositories are the same' do
+ let(:raw_data) { double(base_data.merge(head: source_branch)) }
+
+ it 'returns false' do
+ expect(pull_request.cross_project?).to eq false
+ end
+ end
+ end
+
describe '#url' do
let(:raw_data) { double(base_data) }