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-12-21 03:10:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-21 03:10:18 +0300
commitb6ecd9d9d48e22966bf09358303bff295beaa2d8 (patch)
tree3df771cdb949945880a0d8a1d89e511bd99db066 /spec/serializers/build_details_entity_spec.rb
parentef5bb32f95e10ce5ba3bf991d2315e352b1c5dc5 (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.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb
index 5d29452e91c..1adcf236b98 100644
--- a/spec/serializers/build_details_entity_spec.rb
+++ b/spec/serializers/build_details_entity_spec.rb
@@ -225,5 +225,36 @@ RSpec.describe BuildDetailsEntity do
expect(subject[:artifact].keys).to include(:download_path, :browse_path, :keep_path, :expire_at, :expired, :locked)
end
end
+
+ context 'when the project is public and the user is a guest' do
+ let(:project) { create(:project, :repository, :public) }
+ let(:user) { create(:project_member, :guest, project: project).user }
+
+ context 'when the build has public archive type artifacts' do
+ let(:build) { create(:ci_build, :artifacts) }
+
+ it 'exposes public artifact details' do
+ expect(subject[:artifact].keys).to include(:download_path, :browse_path, :locked)
+ end
+ end
+
+ context 'when the build has non public archive type artifacts' do
+ let(:build) { create(:ci_build, :artifacts, :non_public_artifacts, pipeline: pipeline) }
+
+ it 'does not expose non public artifacts' do
+ expect(subject.keys).not_to include(:artifact)
+ end
+
+ context 'with the non_public_artifacts feature flag disabled' do
+ before do
+ stub_feature_flags(non_public_artifacts: false)
+ end
+
+ it 'exposes artifact details' do
+ expect(subject[:artifact].keys).to include(:download_path, :browse_path, :locked)
+ end
+ end
+ end
+ end
end
end