diff options
author | Matija Čupić <matteeyah@gmail.com> | 2019-05-02 02:16:26 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2019-05-28 18:06:29 +0300 |
commit | 9e6f37744a7f30a181879a1e2799e129c5e795c9 (patch) | |
tree | 46de47d5cc8f85ecd86f85b66e6cbd697a6428c0 /spec/serializers/job_artifact_report_entity_spec.rb | |
parent | 31bd09a3924d1b76cac38996267ffe6ec08cad46 (diff) |
Move JobArtifactEntity to JobArtifactReportEntity
Diffstat (limited to 'spec/serializers/job_artifact_report_entity_spec.rb')
-rw-r--r-- | spec/serializers/job_artifact_report_entity_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/serializers/job_artifact_report_entity_spec.rb b/spec/serializers/job_artifact_report_entity_spec.rb new file mode 100644 index 00000000000..eef5c16d0fb --- /dev/null +++ b/spec/serializers/job_artifact_report_entity_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe JobArtifactReportEntity do + let(:report) { create(:ci_job_artifact, :codequality) } + let(:entity) { described_class.new(report, request: double) } + + describe '#as_json' do + subject { entity.as_json } + + it 'exposes file_type' do + expect(subject[:file_type]).to eq(report.file_type) + end + + it 'exposes file_format' do + expect(subject[:file_format]).to eq(report.file_format) + end + + it 'exposes size' do + expect(subject[:size]).to eq(report.size) + end + + it 'exposes download path' do + expect(subject[:download_path]).to include("jobs/#{report.job.id}/artifacts/download") + end + end +end |