Commit 83a33764 authored by Matija Čupić's avatar Matija Čupić

Enable audit logs in DestroyPipeline specs

parent 5bf6088f
......@@ -456,8 +456,15 @@ describe API::Pipelines do
expect(json_response['message']).to eq '404 Not found'
end
it 'logs an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.to change { SecurityEvent.count }.by(1)
context 'when audit events is enabled' do
before do
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:extended_audit_events).and_return(true)
end
it 'logs an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.to change { SecurityEvent.count }.by(1)
end
end
context 'when the pipeline has jobs' do
......
......@@ -17,8 +17,15 @@ describe ::Ci::DestroyPipelineService do
expect { pipeline.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
it 'logs an audit event' do
expect { subject }.to change { SecurityEvent.count }.by(1)
context 'when audit events is enabled' do
before do
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:extended_audit_events).and_return(true)
end
it 'logs an audit event' do
expect { subject }.to change { SecurityEvent.count }.by(1)
end
end
context 'when the pipeline has jobs' 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