2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe 'Project deploy keys', :js do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project_empty_repo) }
|
|
|
|
|
|
|
|
before do
|
2018-03-17 18:26:18 +05:30
|
|
|
project.add_master(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe 'removing key' do
|
|
|
|
before do
|
|
|
|
create(:deploy_keys_project, project: project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'removes association between project and deploy key' do
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_settings_repository_path(project)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
page.within(find('.deploy-keys')) do
|
|
|
|
expect(page).to have_selector('.deploy-keys li', count: 1)
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
accept_confirm { find(:button, text: 'Remove').send_keys(:return) }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
expect(page).not_to have_selector('.fa-spinner', count: 0)
|
|
|
|
expect(page).to have_selector('.deploy-keys li', count: 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|