Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-11 21:10:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-11 21:10:06 +0300
commit7a1895c74ad57da757c02b2675147a5a5e2cfe6d (patch)
tree7204fd4cdecbf1166f1aebca080994fcb7f290cd /spec/serializers/build_details_entity_spec.rb
parent9dde2726710184f066387d044fce4ae2b3684210 (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.rb28
1 files changed, 27 insertions, 1 deletions
diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb
index ef6472e07a0..3166c08ff4e 100644
--- a/spec/serializers/build_details_entity_spec.rb
+++ b/spec/serializers/build_details_entity_spec.rb
@@ -185,12 +185,38 @@ RSpec.describe BuildDetailsEntity do
end
end
+ context 'when the build has expired artifacts' do
+ let!(:build) { create(:ci_build, :artifacts, artifacts_expire_at: 7.days.ago) }
+
+ it 'does not expose any artifact actions path' do
+ expect(subject[:artifact].keys).not_to include(:download_path, :browse_path, :keep_path)
+ end
+
+ it 'artifact locked is false' do
+ expect(subject.dig(:artifact, :locked)).to eq(false)
+ end
+
+ context 'when the pipeline is artifacts_locked' do
+ before do
+ build.pipeline.update!(locked: :artifacts_locked)
+ end
+
+ it 'artifact locked is true' do
+ expect(subject.dig(:artifact, :locked)).to eq(true)
+ end
+
+ it 'exposes download and browse artifact actions path' do
+ expect(subject[:artifact].keys).to include(:download_path, :browse_path)
+ end
+ end
+ end
+
context 'when the build has archive type artifacts' do
let!(:build) { create(:ci_build, :artifacts, artifacts_expire_at: 7.days.from_now) }
let!(:report) { create(:ci_job_artifact, :codequality, job: build) }
it 'exposes artifact details' do
- expect(subject[:artifact].keys).to include(:download_path, :browse_path, :keep_path, :expire_at, :expired)
+ expect(subject[:artifact].keys).to include(:download_path, :browse_path, :keep_path, :expire_at, :expired, :locked)
end
end
end