diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-06-20 12:37:07 +0300 |
---|---|---|
committer | Alexander Randa <randa.alex@gmail.com> | 2017-06-20 14:23:13 +0300 |
commit | c7bcebd56e264772a8fe177e64476ea7b2b80144 (patch) | |
tree | dc224aa7476c7e8f87df51bb63965d2e9033db4f /spec/requests/api/deploy_keys_spec.rb | |
parent | 5214e507b043c8e71d2826252491cdac97d27416 (diff) |
Fix edit button for deploy keys available from other projects
Diffstat (limited to 'spec/requests/api/deploy_keys_spec.rb')
-rw-r--r-- | spec/requests/api/deploy_keys_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/requests/api/deploy_keys_spec.rb b/spec/requests/api/deploy_keys_spec.rb index 9c260f88f56..32439981b60 100644 --- a/spec/requests/api/deploy_keys_spec.rb +++ b/spec/requests/api/deploy_keys_spec.rb @@ -160,6 +160,16 @@ describe API::DeployKeys do expect(json_response['title']).to eq('new title') expect(json_response['can_push']).to eq(true) end + + it 'updates a private ssh key from projects user has access with correct attributes' do + create(:deploy_keys_project, project: project2, deploy_key: private_deploy_key) + + put api("/projects/#{project.id}/deploy_keys/#{private_deploy_key.id}", admin), { title: 'new title', can_push: true } + + expect(json_response['id']).to eq(private_deploy_key.id) + expect(json_response['title']).to eq('new title') + expect(json_response['can_push']).to eq(true) + end end describe 'DELETE /projects/:id/deploy_keys/:key_id' do |