No space required after WIP identifier
Modified changelog
This commit is contained in:
parent
36f7b624be
commit
6e6a99061d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue