Commit 0547e355 authored by Yorick Peterse's avatar Yorick Peterse

Make API pipeline specs the same for CE and EE

EE had a slightly different audit spec. In this commit we use the CE
code for the shared spec, and move the EE specific spec to a separate
spec file.
parent 22d644f6
# frozen_string_literal: true
require 'spec_helper'
describe API::Pipelines do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, creator: user) }
let!(:pipeline) do
create(:ci_empty_pipeline, project: project, sha: project.commit.id,
ref: project.default_branch, user: user)
end
before do
project.add_maintainer(user)
end
describe 'DELETE /projects/:id/pipelines/:pipeline_id' do
context 'authorized user' do
let(:owner) { project.owner }
context 'when audit events is enabled' do
before do
stub_licensed_features(extended_audit_events: true, admin_audit_log: true)
end
it 'does not log an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.not_to change { SecurityEvent.count }
end
end
end
end
end
......@@ -532,14 +532,8 @@ describe API::Pipelines do
expect(json_response['message']).to eq '404 Not found'
end
context 'when audit events is enabled' do
before do
stub_licensed_features(extended_audit_events: true, admin_audit_log: true)
end
it 'does not log an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.not_to change { SecurityEvent.count }
end
it 'does not log an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.not_to change { SecurityEvent.count }
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