Commit 9e6f3774 authored by Matija Čupić's avatar Matija Čupić

Move JobArtifactEntity to JobArtifactReportEntity

parent 31bd09a3
...@@ -42,7 +42,7 @@ class BuildDetailsEntity < JobEntity ...@@ -42,7 +42,7 @@ class BuildDetailsEntity < JobEntity
end end
end end
expose :reports, if: -> (*) { can?(current_user, :read_build, build) }, using: JobArtifactEntity do |build| expose :reports, if: -> (*) { can?(current_user, :read_build, build) }, using: JobArtifactReportEntity do |build|
build.job_artifacts.merge(Ci::JobArtifact.with_all_reports) build.job_artifacts.merge(Ci::JobArtifact.with_all_reports)
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class JobArtifactEntity < Grape::Entity class JobArtifactReportEntity < Grape::Entity
include RequestAwareEntity include RequestAwareEntity
expose :file_type expose :file_type
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe JobArtifactEntity do describe JobArtifactReportEntity do
let(:report) { create(:ci_job_artifact, :codequality) } let(:report) { create(:ci_job_artifact, :codequality) }
let(:entity) { described_class.new(report, request: double) } let(:entity) { described_class.new(report, request: double) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment