BigW Consortium Gitlab

Commit 6e6a9906 by 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.
v 8.3.0 (unreleased)
- 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
- Improved performance of finding projects and groups in various places
......
......@@ -239,7 +239,7 @@ class MergeRequest < ActiveRecord::Base
end
def work_in_progress?
!!(title =~ /\A\[?WIP\]?:? /i)
!!(title =~ /\A\[?WIP(\]|:| )/i)
end
def mergeable?
......
......@@ -162,6 +162,21 @@ describe MergeRequest 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 "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
subject.title = "Wipwap #{subject.title}"
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