diff options
Diffstat (limited to 'spec/services/ci/job_artifacts')
-rw-r--r-- | spec/services/ci/job_artifacts/create_service_spec.rb | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/spec/services/ci/job_artifacts/create_service_spec.rb b/spec/services/ci/job_artifacts/create_service_spec.rb index a23ba250daf..0d6a15b0ea3 100644 --- a/spec/services/ci/job_artifacts/create_service_spec.rb +++ b/spec/services/ci/job_artifacts/create_service_spec.rb @@ -139,59 +139,19 @@ RSpec.describe Ci::JobArtifacts::CreateService, :clean_gitlab_redis_shared_state shared_examples_for 'handling accessibility' do shared_examples 'public accessibility' do it 'sets accessibility to public level' do + subject + + expect(job.job_artifacts).not_to be_empty expect(job.job_artifacts).to all be_public_accessibility end end shared_examples 'private accessibility' do it 'sets accessibility to private level' do - expect(job.job_artifacts).to all be_private_accessibility - end - end - - context 'when non_public_artifacts flag is disabled' do - before do - stub_feature_flags(non_public_artifacts: false) - end - - it_behaves_like 'public accessibility' - end - - context 'when non_public_artifacts flag is enabled' do - context 'and accessibility is defined in the params' do - context 'and is passed as private' do - before do - params.merge!('accessibility' => 'private') - end - - it_behaves_like 'private accessibility' - end - - context 'and is passed as public' do - before do - params.merge!('accessibility' => 'public') - end - - it_behaves_like 'public accessibility' - end - end - - context 'and accessibility is not defined in the params' do - context 'and job has no public artifacts defined in its CI config' do - it_behaves_like 'public accessibility' - end - - context 'and job artifacts defined as private in the CI config' do - let(:job) { create(:ci_build, :with_private_artifacts_config, project: project) } - - it_behaves_like 'private accessibility' - end - - context 'and job artifacts defined as public in the CI config' do - let(:job) { create(:ci_build, :with_public_artifacts_config, project: project) } + subject - it_behaves_like 'public accessibility' - end + expect(job.job_artifacts).not_to be_empty + expect(job.job_artifacts).to all be_private_accessibility end end |