2017-03-23 10:45:25 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
describe 'Project deploy keys', :js do
|
2017-03-23 10:45:25 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project_empty_repo) }
|
|
|
|
|
|
|
|
before do
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-03-23 10:45:25 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'removing key' do
|
|
|
|
before do
|
|
|
|
create(:deploy_keys_project, project: project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'removes association between project and deploy key' do
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_settings_repository_path(project)
|
2017-03-23 10:45:25 -04:00
|
|
|
|
2017-04-28 15:59:20 -04:00
|
|
|
page.within(find('.deploy-keys')) do
|
2018-05-07 14:21:34 -04:00
|
|
|
expect(page).to have_selector('.deploy-key', count: 1)
|
2017-04-28 15:59:20 -04:00
|
|
|
|
2019-01-24 08:43:02 -05:00
|
|
|
accept_confirm { find('.ic-remove').click }
|
2017-04-28 15:59:20 -04:00
|
|
|
|
2018-06-14 01:05:05 -04:00
|
|
|
wait_for_requests
|
|
|
|
|
2018-05-07 14:21:34 -04:00
|
|
|
expect(page).to have_selector('.deploy-key', count: 0)
|
2017-03-23 10:45:25 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|