diff options
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/models/merge_request.rb | 2 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 481a0f8d243..fc123b22b11 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -180,6 +180,7 @@ v 8.3.0 - Handle and report SSL errors in Web hook test (Stan Hu) - Bump Redis requirement to 2.8 for Sidekiq 4 (Stan Hu) - Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera) + - WIP identifier on merge requests no longer requires trailing space - Add rake tasks for git repository maintainance (Zeger-Jan van de Weg) - Fix 500 error when update group member permission - Fix: As an admin, cannot add oneself as a member to a group/project diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 89b6c49b362..2594a7e3578 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -258,7 +258,7 @@ class MergeRequest < ActiveRecord::Base end def work_in_progress? - !!(title =~ /\A\[?WIP\]?:? /i) + !!(title =~ /\A\[?WIP(\]|:| )/i) end def mergeable? 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 |