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

pipeline_artifacts_shared_example.rb « serializers « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d5ffd5e75101bd94e2d4816d6a5ad18f094a624b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true
RSpec.shared_examples 'public artifacts' do
  let_it_be(:project) { create(:project, :public) }
  let(:pipeline) { create(:ci_empty_pipeline, status: :success, project: project) }

  context 'that has artifacts' do
    let!(:build) { create(:ci_build, :success, :artifacts, pipeline: pipeline) }

    it 'contains information about artifacts' do
      expect(subject[:details][:artifacts].length).to eq(1)
    end
  end

  context 'that has non public artifacts' do
    let!(:build) { create(:ci_build, :success, :artifacts, :non_public_artifacts, pipeline: pipeline) }

    it 'does not contain information about artifacts' do
      expect(subject[:details][:artifacts].length).to eq(0)
    end
  end
end