From f78257cbddd711e18cbce93ad740a4aa0acac347 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 6 Mar 2020 15:08:05 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/models/ci/job_artifact_spec.rb | 6 +++--- spec/models/ci/pipeline_spec.rb | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'spec/models/ci') diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 8f56d735f36..0a7a44b225c 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -25,7 +25,7 @@ describe Ci::JobArtifact do end it_behaves_like 'UpdateProjectStatistics' do - subject { build(:ci_job_artifact, :archive, size: 106365) } + subject { build(:ci_job_artifact, :archive, size: 107464) } end end @@ -35,7 +35,7 @@ describe Ci::JobArtifact do end it_behaves_like 'UpdateProjectStatistics' do - subject { build(:ci_job_artifact, :archive, size: 106365) } + subject { build(:ci_job_artifact, :archive, size: 107464) } end end @@ -173,7 +173,7 @@ describe Ci::JobArtifact do let(:artifact) { create(:ci_job_artifact, :archive, project: project) } it 'sets the size from the file size' do - expect(artifact.size).to eq(106365) + expect(artifact.size).to eq(107464) end end diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 76051ecb177..f775906a545 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -2553,6 +2553,19 @@ describe Ci::Pipeline, :mailer do end end + describe '#find_job_with_archive_artifacts' do + let!(:old_job) { create(:ci_build, name: 'rspec', retried: true, pipeline: pipeline) } + let!(:job_without_artifacts) { create(:ci_build, name: 'rspec', pipeline: pipeline) } + let!(:expected_job) { create(:ci_build, :artifacts, name: 'rspec', pipeline: pipeline ) } + let!(:different_job) { create(:ci_build, name: 'deploy', pipeline: pipeline) } + + subject { pipeline.find_job_with_archive_artifacts('rspec') } + + it 'finds the expected job' do + expect(subject).to eq(expected_job) + end + end + describe '#latest_builds_with_artifacts' do let!(:fresh_build) { create(:ci_build, :success, :artifacts, pipeline: pipeline) } let!(:stale_build) { create(:ci_build, :success, :expired, :artifacts, pipeline: pipeline) } -- cgit v1.2.1