diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-23 17:45:25 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-23 17:49:24 +0300 |
commit | e0d2f249b4884f9525c44119680bf804e8a7ff20 (patch) | |
tree | 7f8598e57a29aa263a6f4d80b3ae6b2f473abffd /spec/features/projects/deploy_keys_spec.rb | |
parent | d576fd82333c79b3f056f26f79e85c0eceb5704b (diff) |
Return 404 if deploy key cannot be found in Projects::DeployKeysController#disable
Closes #29633
Diffstat (limited to 'spec/features/projects/deploy_keys_spec.rb')
-rw-r--r-- | spec/features/projects/deploy_keys_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/features/projects/deploy_keys_spec.rb b/spec/features/projects/deploy_keys_spec.rb new file mode 100644 index 00000000000..0b997f130ea --- /dev/null +++ b/spec/features/projects/deploy_keys_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe 'Project deploy keys', feature: true do + let(:user) { create(:user) } + let(:project) { create(:project_empty_repo) } + + before do + project.team << [user, :master] + login_as(user) + end + + describe 'removing key' do + before do + create(:deploy_keys_project, project: project) + end + + it 'removes association between project and deploy key' do + visit namespace_project_settings_repository_path(project.namespace, project) + + page.within '.deploy-keys' do + expect { click_on 'Remove' } + .to change { project.deploy_keys.count }.by(-1) + end + end + end +end |