Commit 6e6a9906 authored by Ted Hogan's avatar Ted Hogan

No space required after WIP identifier

Modified changelog
parent 36f7b624
...@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased) v 8.3.0 (unreleased)
- Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera) - Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera)
- WIP identifier on merge requests no longer requires trailing space
v 8.2.0 v 8.2.0
- Improved performance of finding projects and groups in various places - Improved performance of finding projects and groups in various places
......
...@@ -239,7 +239,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -239,7 +239,7 @@ class MergeRequest < ActiveRecord::Base
end end
def work_in_progress? def work_in_progress?
!!(title =~ /\A\[?WIP\]?:? /i) !!(title =~ /\A\[?WIP(\]|:| )/i)
end end
def mergeable? def mergeable?
......
...@@ -162,6 +162,21 @@ describe MergeRequest do ...@@ -162,6 +162,21 @@ describe MergeRequest do
expect(subject).to be_work_in_progress expect(subject).to be_work_in_progress
end end
it "detects the 'WIP' prefix" do
subject.title = "WIP#{subject.title}"
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 "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 it "doesn't detect WIP for words starting with WIP" do
subject.title = "Wipwap #{subject.title}" subject.title = "Wipwap #{subject.title}"
expect(subject).not_to be_work_in_progress expect(subject).not_to be_work_in_progress
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment