From 5b66acec09578d44e78259424c9cbebfbc2204ae Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 26 Mar 2019 01:18:49 -0500 Subject: [PATCH] Move EE-specific code in destroy_pipeline_service_spec.rb --- .../ci/destroy_pipeline_service_spec.rb | 21 +++++++++++++++++++ .../ci/destroy_pipeline_service_spec.rb | 10 --------- 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 ee/spec/services/ci/destroy_pipeline_service_spec.rb 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 00000000000000..43efb66c7c7f29 --- /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 6490c3944dce12..74e58fcffee9d3 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) } -- GitLab