From cc4a0d9a470867ba5d0c383720b573dedcf2220e Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 6 May 2019 17:36:02 +0200 Subject: Add specs checking serialization of a stage builds --- spec/serializers/pipeline_entity_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index 93d18f70cdc..6be612ec226 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -64,6 +64,12 @@ describe PipelineEntity do create(:ci_build, :failed, pipeline: pipeline) end + it 'does not serialize stage builds' do + subject.with_indifferent_access.dig(:details, :stages, 0).tap do |stage| + expect(stage).not_to include(:groups, :latest_statuses, :retries) + end + end + context 'user has ability to retry pipeline' do before do project.add_developer(user) @@ -92,6 +98,12 @@ describe PipelineEntity do create(:ci_build, :pending, pipeline: pipeline) end + it 'does not serialize stage builds' do + subject.with_indifferent_access.dig(:details, :stages, 0).tap do |stage| + expect(stage).not_to include(:groups, :latest_statuses, :retries) + end + end + context 'user has ability to cancel pipeline' do before do project.add_developer(user) -- cgit v1.2.1