From 5fdb51240f2093342b0ff0930b8d3798446e0026 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Wed, 31 May 2017 22:10:00 +0200 Subject: [PATCH] Rename build to job --- app/controllers/projects/jobs_controller.rb | 2 +- app/serializers/build_artifact_entity.rb | 8 ++++---- app/serializers/build_details_entity.rb | 2 +- spec/serializers/build_artifact_entity_spec.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index 9b8a9eedfef..cb4f46388fd 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -53,7 +53,7 @@ class Projects::JobsController < Projects::ApplicationController render json: BuildSerializer .new(project: @project, current_user: @current_user) - .represent_status(@build, {}, BuildDetailsEntity) + .represent(@build, {}, BuildDetailsEntity) end end end diff --git a/app/serializers/build_artifact_entity.rb b/app/serializers/build_artifact_entity.rb index 091bc8d6742..cb55c98f7c6 100644 --- a/app/serializers/build_artifact_entity.rb +++ b/app/serializers/build_artifact_entity.rb @@ -10,16 +10,16 @@ class BuildArtifactEntity < Grape::Entity expose :path do |job| download_namespace_project_job_artifacts_path( - build.project.namespace, - build.project, - build) + project.namespace, + project, + job) end expose :keep_path, if: -> (*) { job.has_expiring_artifacts? } do |job| keep_namespace_project_job_artifacts_path( project.namespace, project, - build) + job) end expose :browse_path do |job| diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb index 2d76ce203b9..03c7f238eca 100644 --- a/app/serializers/build_details_entity.rb +++ b/app/serializers/build_details_entity.rb @@ -4,7 +4,7 @@ class BuildDetailsEntity < BuildEntity expose :erased_by, if: -> (*) { build.erased? }, using: UserEntity expose :erase_path, if: -> (*) { build.erasable? && can?(current_user, :update_build, project) } do |build| - erase_namespace_project_build_path(project.namespace, project, build) + erase_namespace_project_job_path(project.namespace, project, build) end expose :artifacts, using: BuildArtifactEntity diff --git a/spec/serializers/build_artifact_entity_spec.rb b/spec/serializers/build_artifact_entity_spec.rb index a2e24ae1535..ad0d3d3839e 100644 --- a/spec/serializers/build_artifact_entity_spec.rb +++ b/spec/serializers/build_artifact_entity_spec.rb @@ -23,10 +23,10 @@ describe BuildArtifactEntity do .to include "jobs/#{job.id}/artifacts/download" expect(subject[:keep_path]) - .to include "jobs/#{build.id}/artifacts/keep" + .to include "jobs/#{job.id}/artifacts/keep" expect(subject[:browse_path]) - .to include "jobs/#{build.id}/artifacts/browse" + .to include "jobs/#{job.id}/artifacts/browse" end end end