Commit 7fd094ee authored by Gary Holtz's avatar Gary Holtz

Adding a "/draft" alias to the "/wip" command

Also including a few specs
parent 1ed7e29d
...@@ -80,7 +80,7 @@ module Gitlab ...@@ -80,7 +80,7 @@ module Gitlab
# Allow it to mark as WIP on MR creation page _or_ through MR notes. # Allow it to mark as WIP on MR creation page _or_ through MR notes.
(quick_action_target.new_record? || current_user.can?(:"update_#{quick_action_target.to_ability_name}", quick_action_target)) (quick_action_target.new_record? || current_user.can?(:"update_#{quick_action_target.to_ability_name}", quick_action_target))
end end
command :wip do command :wip, :draft do
@updates[:wip_event] = quick_action_target.work_in_progress? ? 'unwip' : 'wip' @updates[:wip_event] = quick_action_target.work_in_progress? ? 'unwip' : 'wip'
end end
......
...@@ -1036,6 +1036,16 @@ RSpec.describe QuickActions::InterpretService do ...@@ -1036,6 +1036,16 @@ RSpec.describe QuickActions::InterpretService do
let(:issuable) { merge_request } let(:issuable) { merge_request }
end end
it_behaves_like 'wip command' do
let(:content) { '/draft' }
let(:issuable) { merge_request }
end
it_behaves_like 'unwip command' do
let(:content) { '/draft' }
let(:issuable) { merge_request }
end
it_behaves_like 'empty command' do it_behaves_like 'empty command' do
let(:content) { '/remove_due_date' } let(:content) { '/remove_due_date' }
let(:issuable) { merge_request } let(:issuable) { merge_request }
......
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