diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 15:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 15:07:48 +0300 |
commit | 79d62647bcfad69d7272020acb7d8be5ee5df003 (patch) | |
tree | 008d96a4c5fdfdecda79dae5e942c7df07511c77 /spec/serializers/build_details_entity_spec.rb | |
parent | 1a9d9cc14ec54036548824e3ce17da03960f5f81 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/build_details_entity_spec.rb')
-rw-r--r-- | spec/serializers/build_details_entity_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb index 91c5fd6bf2c..6fe9eaedfeb 100644 --- a/spec/serializers/build_details_entity_spec.rb +++ b/spec/serializers/build_details_entity_spec.rb @@ -176,5 +176,27 @@ describe BuildDetailsEntity do expect(subject[:reports].first[:file_type]).to eq('codequality') end end + + context 'when the build has no archive type artifacts' do + let!(:report) { create(:ci_job_artifact, :codequality, job: build) } + + it 'does not expose any artifact actions path' do + expect(subject[:artifact].keys).not_to include(:download_path, :browse_path, :keep_path) + end + end + + context 'when the build has archive type artifacts' do + let!(:report) { create(:ci_job_artifact, :codequality, job: build) } + let!(:archive) { create(:ci_job_artifact, :archive, job: build) } + let!(:metadata) { create(:ci_job_artifact, :metadata, job: build) } + + before do + build.update(artifacts_expire_at: 7.days.from_now) + end + + it 'exposes artifact details' do + expect(subject[:artifact].keys).to include(:download_path, :browse_path, :keep_path, :expire_at, :expired) + end + end end end |