diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /spec/models/commit_spec.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 63fe6923630..ac0ae17f8f7 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -799,7 +799,7 @@ eos describe '#work_in_progress?' do [ 'squash! ', 'fixup! ', 'wip: ', 'WIP: ', '[WIP] ', - 'draft: ', 'Draft - ', '[Draft] ', '(draft) ', 'Draft: ' + 'draft: ', '[Draft] ', '(draft) ', 'Draft: ' ].each do |wip_prefix| it "detects the '#{wip_prefix}' prefix" do commit.message = "#{wip_prefix}#{commit.message}" @@ -814,22 +814,18 @@ eos expect(commit).to be_work_in_progress end - it "detects WIP for a commit just saying 'draft'" do + it "does not detect WIP for a commit just saying 'draft'" do commit.message = "draft" - expect(commit).to be_work_in_progress - end - - it "doesn't detect WIP for a commit that begins with 'FIXUP! '" do - commit.message = "FIXUP! #{commit.message}" - expect(commit).not_to be_work_in_progress end - it "doesn't detect WIP for words starting with WIP" do - commit.message = "Wipout #{commit.message}" + ["FIXUP!", "Draft - ", "Wipeout"].each do |draft_prefix| + it "doesn't detect '#{draft_prefix}' at the start of the title as a draft" do + commit.message = "#{draft_prefix} #{commit.message}" - expect(commit).not_to be_work_in_progress + expect(commit).not_to be_work_in_progress + end end end |