summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-02-18 04:50:17 +0000
committerStan Hu <stanhu@gmail.com>2018-02-18 04:50:17 +0000
commit557db7e635c70bf68a15f7029014301013b30070 (patch)
tree8436d5fe2b11bddc5e97c21939d918362d74742a /spec/lib
parentcd82683e79e3c1cffe28ff1cf458ee8d84577e69 (diff)
parent3a9a80315537c48a2fb3c338e0f8c76b3f9aa06d (diff)
downloadgitlab-ce-557db7e635c70bf68a15f7029014301013b30070.tar.gz
Merge branch '17500-mr-multiple-issues-oxford-comma' into 'master'
Update issue closing pattern to be more forgiving Closes #17500 See merge request gitlab-org/gitlab-ce!17198
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/closing_issue_extractor_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb
index 28c679af12a..8d4862932b2 100644
--- a/spec/lib/gitlab/closing_issue_extractor_spec.rb
+++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb
@@ -365,6 +365,20 @@ describe Gitlab::ClosingIssueExtractor do
.to match_array([issue, other_issue, third_issue])
end
+ it 'allows oxford commas (comma before and) when referencing multiple issues' do
+ message = "Closes #{reference}, #{reference2}, and #{reference3}"
+
+ expect(subject.closed_by_message(message))
+ .to match_array([issue, other_issue, third_issue])
+ end
+
+ it 'allows spaces before commas when referencing multiple issues' do
+ message = "Closes #{reference} , #{reference2} , and #{reference3}"
+
+ expect(subject.closed_by_message(message))
+ .to match_array([issue, other_issue, third_issue])
+ end
+
it 'fetches issues in multi-line message' do
message = "Awesome commit (closes #{reference})\nAlso fixes #{reference2}"