From b795e3a069ec3d6fdfb5fc5942310166de349cd9 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Fri, 24 Feb 2017 09:23:19 +0100 Subject: Update tests to pass --- lib/api/v3/deployments.rb | 58 ++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'lib/api/v3/deployments.rb') diff --git a/lib/api/v3/deployments.rb b/lib/api/v3/deployments.rb index c5feb49b22f..81673ae8814 100644 --- a/lib/api/v3/deployments.rb +++ b/lib/api/v3/deployments.rb @@ -1,40 +1,42 @@ module API - # Deployments RESTfull API endpoints - class Deployments < Grape::API - include PaginationParams + module V3 + # Deployments RESTfull API endpoints + class Deployments < Grape::API + include PaginationParams - before { authenticate! } + before { authenticate! } - params do - requires :id, type: String, desc: 'The project ID' - end - resource :projects do - desc 'Get all deployments of the project' do - detail 'This feature was introduced in GitLab 8.11.' - success Entities::Deployment - end params do - use :pagination + requires :id, type: String, desc: 'The project ID' end - get ':id/deployments' do - authorize! :read_deployment, user_project + resource :projects do + desc 'Get all deployments of the project' do + detail 'This feature was introduced in GitLab 8.11.' + success Entities::Deployment + end + params do + use :pagination + end + get ':id/deployments' do + authorize! :read_deployment, user_project - present paginate(user_project.deployments), with: Entities::Deployment - end + present paginate(user_project.deployments), with: Entities::Deployment + end - desc 'Gets a specific deployment' do - detail 'This feature was introduced in GitLab 8.11.' - success Entities::Deployment - end - params do - requires :deployment_id, type: Integer, desc: 'The deployment ID' - end - get ':id/deployments/:deployment_id' do - authorize! :read_deployment, user_project + desc 'Gets a specific deployment' do + detail 'This feature was introduced in GitLab 8.11.' + success Entities::Deployment + end + params do + requires :deployment_id, type: Integer, desc: 'The deployment ID' + end + get ':id/deployments/:deployment_id' do + authorize! :read_deployment, user_project - deployment = user_project.deployments.find(params[:deployment_id]) + deployment = user_project.deployments.find(params[:deployment_id]) - present deployment, with: Entities::Deployment + present deployment, with: Entities::Deployment + end end end end -- cgit v1.2.1