diff options
author | Vicky Chijwani <vickychijwani@gmail.com> | 2018-02-17 19:47:21 +0300 |
---|---|---|
committer | Vicky Chijwani <vickychijwani@gmail.com> | 2018-02-17 20:16:07 +0300 |
commit | 50cdf41e7e1bac48cb9d3e5414682e1bd59e5db9 (patch) | |
tree | 439cd8602f524b82b9a6be82e3d04d4075449044 /spec/lib/gitlab/closing_issue_extractor_spec.rb | |
parent | 35ee6307399f1d92b90183a83cdf4b77a4d601f9 (diff) |
Allow oxford commas and spaces before commas in MR issue closing pattern.
Diffstat (limited to 'spec/lib/gitlab/closing_issue_extractor_spec.rb')
-rw-r--r-- | spec/lib/gitlab/closing_issue_extractor_spec.rb | 14 |
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}" |