diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-06 15:08:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-06 15:08:05 +0000 |
commit | f78257cbddd711e18cbce93ad740a4aa0acac347 (patch) | |
tree | 7f018abe3ce1c0010879cc480f348a35e616fabb /spec/models/ci | |
parent | f500600a43b531e2e7a5858b74bd35312b02c349 (diff) | |
download | gitlab-ce-f78257cbddd711e18cbce93ad740a4aa0acac347.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 13 |
2 files changed, 16 insertions, 3 deletions
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) } |