diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-02-04 09:49:54 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-02-04 09:49:54 +0000 |
commit | a1fa973123796ce27559063a644f093539107a7f (patch) | |
tree | 7b73753a3f1642880cd05c3b35d1b7a31028825e /spec | |
parent | 8d948744461619ac3561be93d545d72343efa0cd (diff) | |
parent | f0c2f7481febf1e1149cb3dba87780c462759d14 (diff) | |
download | gitlab-ce-a1fa973123796ce27559063a644f093539107a7f.tar.gz |
Merge branch 'wipMergeSpacing' into 'master'
No space required after WIP identifier
Fixes #2426
Currently, the WIP: (or any other variation) prefix of a merge request title must include a trailing space for it to be recognized as a work in progress and prevent merging.
To resolve this, I added an or pattern to the regexp to look for any one of the three possible delimiters ':', ']', or ' '. This way the trailing space isn't required but it still won't mark any titles beginning with wip as work in progress (e.g. "Wipwap").
See merge request !1876
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/merge_request_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 46f2f20b986..cd1953bfc5e 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -188,6 +188,11 @@ describe MergeRequest, models: true do expect(subject).to be_work_in_progress end + it "detects the '[WIP]' prefix" do + subject.title = "[WIP]#{subject.title}" + expect(subject).to be_work_in_progress + end + it "doesn't detect WIP for words starting with WIP" do subject.title = "Wipwap #{subject.title}" expect(subject).not_to be_work_in_progress |