summaryrefslogtreecommitdiff
path: root/spec/models/ci/build_spec.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-10-02 17:01:26 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-10-02 17:01:26 +0000
commit48c911b75e96563991387dc1c7b3aaa071d511cc (patch)
tree922137e8f162cf74b3965fc39ac1913b1049f0f5 /spec/models/ci/build_spec.rb
parentc0a982fad665e28769967b17eddd90900f62be78 (diff)
downloadgitlab-ce-48c911b75e96563991387dc1c7b3aaa071d511cc.tar.gz
CE Resolve "Refactor code quality similar to JUnit tests"
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r--spec/models/ci/build_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index e82d93d5935..61fd079def2 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -1278,6 +1278,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,