summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index ddda04faaf1..cfa87b3e39e 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Commit do
+RSpec.describe Commit do
let_it_be(:project) { create(:project, :public, :repository) }
let_it_be(:personal_snippet) { create(:personal_snippet, :repository) }
let_it_be(:project_snippet) { create(:project_snippet, :repository) }
@@ -675,7 +675,10 @@ eos
end
describe '#work_in_progress?' do
- ['squash! ', 'fixup! ', 'wip: ', 'WIP: ', '[WIP] '].each do |wip_prefix|
+ [
+ 'squash! ', 'fixup! ', 'wip: ', 'WIP: ', '[WIP] ',
+ 'draft: ', 'Draft - ', '[Draft] ', '(draft) ', 'Draft: '
+ ].each do |wip_prefix|
it "detects the '#{wip_prefix}' prefix" do
commit.message = "#{wip_prefix}#{commit.message}"
@@ -689,6 +692,12 @@ eos
expect(commit).to be_work_in_progress
end
+ it "detects 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}"