summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-05-06 17:36:02 +0200
committerFilipa Lacerda <filipa@gitlab.com>2019-05-24 10:04:05 +0100
commitcc4a0d9a470867ba5d0c383720b573dedcf2220e (patch)
tree48d2943103f03ac7c3ba4974c735f36c2267954e
parentde24df98a3a20f87f5fed513d27a20b6238d6959 (diff)
downloadgitlab-ce-cc4a0d9a470867ba5d0c383720b573dedcf2220e.tar.gz
Add specs checking serialization of a stage builds
-rw-r--r--spec/serializers/pipeline_entity_spec.rb12
1 files changed, 12 insertions, 0 deletions
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)