summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-08-04 16:41:20 +0200
committerRémy Coutable <remy@rymai.me>2016-08-04 16:41:20 +0200
commit42373550b0d5548fc9ebded4a015860ac61dc742 (patch)
tree3c9eb8991f297c8a499d5dd52b7b85e8a3fe9666 /spec
parent0be668369d566e1394161cc5a5eb2fe3221c1552 (diff)
parentd3c1e93d554a6cff4df0b149b5b109b6cfc546b9 (diff)
downloadgitlab-ce-42373550b0d5548fc9ebded4a015860ac61dc742.tar.gz
Merge branch 'master' of https://dev.gitlab.org/gitlab/gitlabhq
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/closing_issue_extractor_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb
index e9b8ce6b5bb..de3f64249a2 100644
--- a/spec/lib/gitlab/closing_issue_extractor_spec.rb
+++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb
@@ -3,10 +3,12 @@ require 'spec_helper'
describe Gitlab::ClosingIssueExtractor, lib: true do
let(:project) { create(:project) }
let(:project2) { create(:project) }
+ let(:forked_project) { Projects::ForkService.new(project, project.creator).execute }
let(:issue) { create(:issue, project: project) }
let(:issue2) { create(:issue, project: project2) }
let(:reference) { issue.to_reference }
let(:cross_reference) { issue2.to_reference(project) }
+ let(:fork_cross_reference) { issue.to_reference(forked_project) }
subject { described_class.new(project, project.creator) }
@@ -278,6 +280,15 @@ describe Gitlab::ClosingIssueExtractor, lib: true do
end
end
+ context "with a cross-project fork reference" do
+ subject { described_class.new(forked_project, forked_project.creator) }
+
+ it do
+ message = "Closes #{fork_cross_reference}"
+ expect(subject.closed_by_message(message)).to be_empty
+ end
+ end
+
context "with an invalid URL" do
it do
message = "Closes https://google.com#{urls.namespace_project_issue_path(issue2.project.namespace, issue2.project, issue2)}"