summaryrefslogtreecommitdiff
path: root/spec/services/quick_actions/interpret_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/quick_actions/interpret_service_spec.rb')
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index a9de0a747f6..1bd402e38be 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -1621,6 +1621,29 @@ describe QuickActions::InterpretService do
expect(message).to eq("Created branch '#{branch_name}' and a merge request to resolve this issue.")
end
end
+
+ context 'submit_review command' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:note) do
+ [
+ 'I like it',
+ '/submit_review'
+ ]
+ end
+
+ with_them do
+ let(:content) { '/submit_review' }
+ let!(:draft_note) { create(:draft_note, note: note, merge_request: merge_request, author: developer) }
+
+ it 'submits the users current review' do
+ _, _, message = service.execute(content, merge_request)
+
+ expect { draft_note.reload }.to raise_error(ActiveRecord::RecordNotFound)
+ expect(message).to eq('Submitted the current review.')
+ end
+ end
+ end
end
describe '#explain' do