diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-10-03 10:33:33 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-10-03 10:33:33 +0900 |
commit | 41fe9edcf75a96db2f29c172828e6adf0ca5b0c9 (patch) | |
tree | 905817422a31aafb8b4cc7981abaddf613f466e0 /spec/models | |
parent | e5e307dd75f74c5e98b039332c58170dc9c2735f (diff) | |
parent | 42822a7d45f063804fe04f44e15cf04549460ae7 (diff) | |
download | gitlab-ce-41fe9edcf75a96db2f29c172828e6adf0ca5b0c9.tar.gz |
Merge branch 'master-ce' into scheduled-manual-jobs
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/build_spec.rb | 13 | ||||
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index ffad82c7820..31bcfe1c6b1 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1433,6 +1433,19 @@ describe Ci::Build do end end + describe '#artifacts_file_for_type' do + let(:build) { create(:ci_build, :artifacts) } + let(:file_type) { :archive } + + subject { build.artifacts_file_for_type(file_type) } + + it 'queries artifacts for type' do + expect(build).to receive_message_chain(:job_artifacts, :find_by).with(file_type: Ci::JobArtifact.file_types[file_type]) + + subject + end + end + describe '#merge_request' do def create_mr(build, pipeline, factory: :merge_request, created_at: Time.now) create(factory, source_project: pipeline.project, diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 2f449d617be..85fad77a242 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -34,7 +34,7 @@ describe Ci::JobArtifact do describe '.erasable' do subject { described_class.erasable } - context 'when there is am erasable artifact' do + context 'when there is an erasable artifact' do let!(:artifact) { create(:ci_job_artifact, :junit) } it { is_expected.to eq([artifact]) } |