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

Use table-driven spec

parent c2a219d1
......@@ -709,27 +709,23 @@ describe QuickActions::InterpretService do
end
context 'submit_review command' 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) }
using RSpec::Parameterized::TableSyntax
before do
stub_licensed_features(batch_comments: true)
where(:note) do
[
'I like it',
'/submit_review'
]
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)
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) }
expect { draft_note.reload }.to raise_error(ActiveRecord::RecordNotFound)
expect(message).to eq('Submitted the current review.')
before do
stub_licensed_features(batch_comments: true)
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