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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-05-25 03:08:53 +0300
committerMatija Čupić <matteeyah@gmail.com>2019-05-28 18:06:29 +0300
commit1542b160f18b30a8ec28fbdc9c52694b5dfd6f62 (patch)
tree69fc1f1d07def22b22068ceb57f2452a085cf17c /spec/models
parentc86fa0e45e4a053090b5c17b9678120e39f696a6 (diff)
Extract Ci::Build#report_artifacts into method
Extracts combining the job_artifacts relation with the with_reports scope for getting report artifacts into a method.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/build_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index bc81c34f7ab..32eef9e0e01 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -3490,6 +3490,18 @@ describe Ci::Build do
end
end
+ describe '#report_artifacts' do
+ subject { build.report_artifacts }
+
+ context 'when the build has reports' do
+ let!(:report) { create(:ci_job_artifact, :codequality, job: build) }
+
+ it 'returns the artifacts with reports' do
+ expect(subject).to contain_exactly(report)
+ end
+ end
+ end
+
describe '#artifacts_metadata_entry' do
set(:build) { create(:ci_build, project: project) }
let(:path) { 'other_artifacts_0.1.2/another-subdirectory/banana_sample.gif' }