2017-03-23 14:45:25 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 04:13:10 +00:00
|
|
|
describe 'Project deploy keys', :js do
|
2017-03-23 14:45:25 +00:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project_empty_repo) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(user)
|
2017-03-23 14:45:25 +00: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 16:20:50 +00:00
|
|
|
visit project_settings_repository_path(project)
|
2017-03-23 14:45:25 +00:00
|
|
|
|
2017-04-28 19:59:20 +00:00
|
|
|
page.within(find('.deploy-keys')) do
|
|
|
|
expect(page).to have_selector('.deploy-keys li', count: 1)
|
|
|
|
|
|
|
|
click_on 'Remove'
|
|
|
|
|
|
|
|
expect(page).not_to have_selector('.fa-spinner', count: 0)
|
|
|
|
expect(page).to have_selector('.deploy-keys li', count: 0)
|
2017-03-23 14:45:25 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|