Commit ba01e519 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Incorporate feedback

parent 182e2814
...@@ -260,10 +260,10 @@ GET /projects/:id/deployments/:deployment_id ...@@ -260,10 +260,10 @@ GET /projects/:id/deployments/:deployment_id
| Attribute | Type | Required | Description | | Attribute | Type | Required | Description |
|-----------|---------|----------|---------------------| |-----------|---------|----------|---------------------|
| `id` | integer | yes | The ID of a project | | `id` | integer | yes | The ID of a project |
| `deployment_id` | string | yes | The ID of the deployment | | `deployment_id` | integer | yes | The ID of the deployment |
```bash ```bash
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/deployment/1" curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/deployments/1"
``` ```
Example of response Example of response
......
...@@ -202,15 +202,13 @@ module API ...@@ -202,15 +202,13 @@ module API
build = get_build!(params[:build_id]) build = get_build!(params[:build_id])
if build.playable? bad_request!("Unplayable Build") unless build.playable?
build.play(current_user)
status 200 build.play(current_user)
present build, with: Entities::Build,
user_can_download_artifacts: can?(current_user, :read_build, user_project) status 200
else present build, with: Entities::Build,
bad_request!("Unplayable Build") user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
end end
end end
......
...@@ -419,6 +419,7 @@ describe API::API, api: true do ...@@ -419,6 +419,7 @@ describe API::API, api: true do
it 'plays the build' do it 'plays the build' do
expect(response).to have_http_status 200 expect(response).to have_http_status 200
expect(json_response['user']['id']).to eq(user.id) expect(json_response['user']['id']).to eq(user.id)
expect(json_response['id']).to eq(build.id)
end end
end end
......
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