diff options
author | Mark Fletcher <mark@gitlab.com> | 2017-04-05 09:22:28 +0300 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2017-04-05 09:22:28 +0300 |
commit | 4865a7ab92bd74f6376d50be4dd3b2e3937c5841 (patch) | |
tree | 84860e331b7c196b6a117503d072cc0a7d55ca23 /spec | |
parent | ced322c5f6de61c30794140a08fa45b612474850 (diff) |
Enable creation of deploy keys with write access via the API
* Documentation was incorrectly advertising the missing param
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/keys.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/deploy_keys_spec.rb | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/factories/keys.rb b/spec/factories/keys.rb index dd93b439b2b..4e140102492 100644 --- a/spec/factories/keys.rb +++ b/spec/factories/keys.rb @@ -23,5 +23,9 @@ FactoryGirl.define do factory :another_deploy_key, class: 'DeployKey' do end end + + factory :write_access_key, class: 'DeployKey' do + can_push true + end end end diff --git a/spec/requests/api/deploy_keys_spec.rb b/spec/requests/api/deploy_keys_spec.rb index 4f4b18cf0e0..e1beac28dab 100644 --- a/spec/requests/api/deploy_keys_spec.rb +++ b/spec/requests/api/deploy_keys_spec.rb @@ -108,6 +108,15 @@ describe API::DeployKeys, api: true do expect(response).to have_http_status(201) end + + it 'accepts can_push parameter' do + key_attrs = attributes_for :write_access_key + + post api("/projects/#{project.id}/deploy_keys", admin), key_attrs + + expect(response).to have_http_status(201) + expect(json_response['can_push']).to eq(true) + end end describe 'DELETE /projects/:id/deploy_keys/:key_id' do |