diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-21 03:10:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-21 03:10:18 +0300 |
commit | b6ecd9d9d48e22966bf09358303bff295beaa2d8 (patch) | |
tree | 3df771cdb949945880a0d8a1d89e511bd99db066 /spec/serializers/pipeline_details_entity_spec.rb | |
parent | ef5bb32f95e10ce5ba3bf991d2315e352b1c5dc5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/pipeline_details_entity_spec.rb')
-rw-r--r-- | spec/serializers/pipeline_details_entity_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/serializers/pipeline_details_entity_spec.rb b/spec/serializers/pipeline_details_entity_spec.rb index 1357836cb89..d3474f333b9 100644 --- a/spec/serializers/pipeline_details_entity_spec.rb +++ b/spec/serializers/pipeline_details_entity_spec.rb @@ -183,5 +183,26 @@ RSpec.describe PipelineDetailsEntity do expect(source_jobs[child_pipeline.id][:name]).to eq('child') end end + + context 'when a pipeline belongs to a public project' do + let(:project) { create(:project, :public) } + let(:pipeline) { create(:ci_empty_pipeline, status: :success, project: project) } + + context 'that has artifacts' do + let!(:build) { create(:ci_build, :success, :artifacts, pipeline: pipeline) } + + it 'contains information about artifacts' do + expect(subject[:details][:artifacts].length).to eq(1) + end + end + + context 'that has non public artifacts' do + let!(:build) { create(:ci_build, :success, :artifacts, :non_public_artifacts, pipeline: pipeline) } + + it 'does not contain information about artifacts' do + expect(subject[:details][:artifacts].length).to eq(0) + end + end + end end end |