From 346c2ebb5a818524c5d8d95dc6b9fc8c892e3b5c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 18 May 2021 15:10:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/serializers/ci/pipeline_entity_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec/serializers') diff --git a/spec/serializers/ci/pipeline_entity_spec.rb b/spec/serializers/ci/pipeline_entity_spec.rb index 58b28de09b1..054406e4e65 100644 --- a/spec/serializers/ci/pipeline_entity_spec.rb +++ b/spec/serializers/ci/pipeline_entity_spec.rb @@ -239,23 +239,23 @@ RSpec.describe Ci::PipelineEntity do end context 'when pipeline has failed builds' do - let_it_be(:pipeline) { create(:ci_pipeline, user: user) } + let_it_be(:pipeline) { create(:ci_pipeline, project: project, user: user) } let_it_be(:build) { create(:ci_build, :success, pipeline: pipeline) } let_it_be(:failed_1) { create(:ci_build, :failed, pipeline: pipeline) } let_it_be(:failed_2) { create(:ci_build, :failed, pipeline: pipeline) } context 'when the user can retry the pipeline' do - it 'exposes these failed builds' do - allow(entity).to receive(:can_retry?).and_return(true) + before do + project.add_maintainer(user) + end + it 'exposes these failed builds' do expect(subject[:failed_builds].map { |b| b[:id] }).to contain_exactly(failed_1.id, failed_2.id) end end context 'when the user cannot retry the pipeline' do it 'is nil' do - allow(entity).to receive(:can_retry?).and_return(false) - expect(subject[:failed_builds]).to be_nil end end -- cgit v1.2.3