diff options
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/cancel_user_pipelines_service_spec.rb | 35 | ||||
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/ci/retry_pipeline_service_spec.rb | 2 |
3 files changed, 2 insertions, 37 deletions
diff --git a/spec/services/ci/cancel_user_pipelines_service_spec.rb b/spec/services/ci/cancel_user_pipelines_service_spec.rb deleted file mode 100644 index 8491242dfd5..00000000000 --- a/spec/services/ci/cancel_user_pipelines_service_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Ci::CancelUserPipelinesService do - describe '#execute' do - let(:user) { create(:user) } - - subject { described_class.new.execute(user) } - - context 'when user has running CI pipelines' do - let(:pipeline) { create(:ci_pipeline, :running, user: user) } - let!(:build) { create(:ci_build, :running, pipeline: pipeline) } - - it 'cancels all running pipelines and related jobs', :sidekiq_might_not_need_inline do - subject - - expect(pipeline.reload).to be_canceled - expect(build.reload).to be_canceled - end - end - - context 'when an error ocurrs' do - it 'raises a service level error' do - service = double(execute: ServiceResponse.error(message: 'Error canceling pipeline')) - allow(::Ci::CancelUserPipelinesService).to receive(:new).and_return(service) - - result = subject - - expect(result).to be_a(ServiceResponse) - expect(result).to be_error - end - end - end -end diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index bdf60bb3fdc..7dd3d963e56 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -181,7 +181,7 @@ RSpec.describe Ci::RetryBuildService do end it 'resolves todos for old build that failed' do - expect(MergeRequests::AddTodoWhenBuildFailsService) + expect(::MergeRequests::AddTodoWhenBuildFailsService) .to receive_message_chain(:new, :close) service.execute(build) diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index 3c6a99efbf8..3e2e9f07723 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -272,7 +272,7 @@ RSpec.describe Ci::RetryPipelineService, '#execute' do end it 'closes all todos about failed jobs for pipeline' do - expect(MergeRequests::AddTodoWhenBuildFailsService) + expect(::MergeRequests::AddTodoWhenBuildFailsService) .to receive_message_chain(:new, :close_all) service.execute(pipeline) |