diff options
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r-- | spec/models/ci/build_spec.rb | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 2e552c8d524..18c7e57d464 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -987,6 +987,28 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def describe '#artifacts_public?' do subject { build.artifacts_public? } + context 'artifacts with defaults - public' do + let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) } + + it { is_expected.to be_truthy } + end + + context 'non public artifacts' do + let(:build) { create(:ci_build, :private_artifacts, pipeline: pipeline) } + + it { is_expected.to be_falsey } + end + + context 'no artifacts' do + let(:build) { create(:ci_build, pipeline: pipeline) } + + it { is_expected.to be_truthy } + end + end + + describe '#artifact_is_public_in_config?' do + subject { build.artifact_is_public_in_config? } + context 'artifacts with defaults' do let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) } @@ -994,10 +1016,22 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end context 'non public artifacts' do - let(:build) { create(:ci_build, :artifacts, :with_private_artifacts_config, pipeline: pipeline) } + let(:build) { create(:ci_build, :with_private_artifacts_config, pipeline: pipeline) } it { is_expected.to be_falsey } end + + context 'public artifacts' do + let(:build) { create(:ci_build, :with_public_artifacts_config, pipeline: pipeline) } + + it { is_expected.to be_truthy } + end + + context 'no artifacts' do + let(:build) { create(:ci_build, pipeline: pipeline) } + + it { is_expected.to be_truthy } + end end describe '#artifacts_expired?' do |