diff options
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 |