Merge branch 'bugfix/deploy_keys__can_push__usage_in_api' into 'master'
Add missing `can_push` parameter to POST /v3/deploy_keys See merge request !11607
This commit is contained in:
commit
f07aee72be
3 changed files with 14 additions and 0 deletions
4
changelogs/unreleased/bugfix-v3-deploy_keys-can_push.yml
Normal file
4
changelogs/unreleased/bugfix-v3-deploy_keys-can_push.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: "Fixed handling of the `can_push` attribute in the v3 deploy_keys api"
|
||||||
|
merge_request: 11607
|
||||||
|
author: Richard Clamp
|
|
@ -41,6 +41,7 @@ module API
|
||||||
params do
|
params do
|
||||||
requires :key, type: String, desc: 'The new deploy key'
|
requires :key, type: String, desc: 'The new deploy key'
|
||||||
requires :title, type: String, desc: 'The name of the deploy key'
|
requires :title, type: String, desc: 'The name of the deploy key'
|
||||||
|
optional :can_push, type: Boolean, desc: "Can deploy key push to the project's repository"
|
||||||
end
|
end
|
||||||
post ":id/#{path}" do
|
post ":id/#{path}" do
|
||||||
params[:key].strip!
|
params[:key].strip!
|
||||||
|
|
|
@ -105,6 +105,15 @@ describe API::V3::DeployKeys do
|
||||||
|
|
||||||
expect(response).to have_http_status(201)
|
expect(response).to have_http_status(201)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'accepts can_push parameter' do
|
||||||
|
key_attrs = attributes_for :write_access_key
|
||||||
|
|
||||||
|
post v3_api("/projects/#{project.id}/#{path}", admin), key_attrs
|
||||||
|
|
||||||
|
expect(response).to have_http_status(201)
|
||||||
|
expect(json_response['can_push']).to eq(true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "DELETE /projects/:id/#{path}/:key_id" do
|
describe "DELETE /projects/:id/#{path}/:key_id" do
|
||||||
|
|
Loading…
Reference in a new issue