Move JobArtifactEntity to JobArtifactReportEntity

This commit is contained in:
Matija Čupić 2019-05-01 19:16:26 -04:00
parent 31bd09a392
commit 9e6f37744a
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
3 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ class BuildDetailsEntity < JobEntity
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)
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
class JobArtifactEntity < Grape::Entity
class JobArtifactReportEntity < Grape::Entity
include RequestAwareEntity
expose :file_type

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe JobArtifactEntity do
describe JobArtifactReportEntity do
let(:report) { create(:ci_job_artifact, :codequality) }
let(:entity) { described_class.new(report, request: double) }