diff --git a/ee/spec/services/ci/destroy_pipeline_service_spec.rb b/ee/spec/services/ci/destroy_pipeline_service_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..43efb66c7c7f29b6235c0a5cac7c0fd037a00614 --- /dev/null +++ b/ee/spec/services/ci/destroy_pipeline_service_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ::Ci::DestroyPipelineService do + let(:project) { create(:project) } + let!(:pipeline) { create(:ci_pipeline, project: project) } + let(:user) { project.owner } + + subject { described_class.new(project, user).execute(pipeline) } + + 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 { subject }.not_to change { SecurityEvent.count } + end + end +end diff --git a/spec/services/ci/destroy_pipeline_service_spec.rb b/spec/services/ci/destroy_pipeline_service_spec.rb index 6490c3944dce129fc7c53ec696dadfd20a337997..74e58fcffee9d3ebc4bf790a88a1f84b43d45c9c 100644 --- a/spec/services/ci/destroy_pipeline_service_spec.rb +++ b/spec/services/ci/destroy_pipeline_service_spec.rb @@ -17,16 +17,6 @@ expect { pipeline.reload }.to raise_error(ActiveRecord::RecordNotFound) 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 { subject }.not_to change { SecurityEvent.count } - end - end - context 'when the pipeline has jobs' do let!(:build) { create(:ci_build, project: project, pipeline: pipeline) }