diff options
Diffstat (limited to 'spec/services/ci/retry_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/retry_pipeline_service_spec.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index fc2c66e7f73..6d991baafd0 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -451,22 +451,18 @@ RSpec.describe Ci::RetryPipelineService, '#execute', feature_category: :continuo before do project.add_maintainer(user) - create(:merge_request, - source_project: forked_project, - target_project: project, - source_branch: 'fixes', - allow_collaboration: true) - create_build('rspec 1', :failed, test_stage) - end - it 'allows to retry failed pipeline' do - allow_any_instance_of(Project).to receive(:branch_allows_collaboration?).and_return(true) + create_build('rspec 1', :failed, test_stage, project: project, ref: pipeline.ref) + allow_any_instance_of(Project).to receive(:empty_repo?).and_return(false) + allow_any_instance_of(Project).to receive(:branch_allows_collaboration?).and_return(true) + end + it 'allows to retry failed pipeline' do service.execute(pipeline) expect(build('rspec 1')).to be_pending - expect(pipeline.reload).to be_running + expect(pipeline).to be_running end end |