Commit ae3f4e13 authored by Peter Leitzen's avatar Peter Leitzen Committed by Sean McGivern

You cannot `/award` a Commit

parent 9fab9471
...@@ -394,7 +394,8 @@ module QuickActions ...@@ -394,7 +394,8 @@ module QuickActions
end end
params ':emoji:' params ':emoji:'
condition do condition do
issuable.persisted? issuable.is_a?(Issuable) &&
issuable.persisted?
end end
parse_params do |emoji_param| parse_params do |emoji_param|
match = emoji_param.match(Banzai::Filter::EmojiFilter.emoji_pattern) match = emoji_param.match(Banzai::Filter::EmojiFilter.emoji_pattern)
......
...@@ -1057,6 +1057,12 @@ describe QuickActions::InterpretService do ...@@ -1057,6 +1057,12 @@ describe QuickActions::InterpretService do
let(:issuable) { issue } let(:issuable) { issue }
end end
end end
context 'if issuable is a Commit' do
let(:content) { '/award :100:' }
let(:issuable) { commit }
it_behaves_like 'empty command'
end
end end
context '/shrug command' do context '/shrug command' do
......
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