Commit 651ff7df authored by James Fargher's avatar James Fargher

Use table-driven spec

parent c2a219d1
......@@ -709,6 +709,16 @@ describe QuickActions::InterpretService do
end
context 'submit_review command' do
using RSpec::Parameterized::TableSyntax
where(:note) do
[
'I like it',
'/submit_review'
]
end
with_them do
let(:merge_request) { create(:merge_request, source_project: project) }
let(:content) { '/submit_review' }
let!(:draft_note) { create(:draft_note, note: note, merge_request: merge_request, author: current_user) }
......@@ -717,20 +727,6 @@ describe QuickActions::InterpretService do
stub_licensed_features(batch_comments: true)
end
context 'note has normal text' do
let(:note) { 'I like it' }
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
context 'note has /submit_review' do
let(:note) { '/submit_review' }
it 'submits the users current review' do
_, _, message = service.execute(content, 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