diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/features/profiles | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/keys_spec.rb | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index b5e784a749f..23bbe9c1587 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -71,21 +71,35 @@ RSpec.describe 'Profile > SSH Keys' do expect(page).to have_content(key.title) end - it 'User removes a key via the key index' do - create(:key, user: user) - visit profile_keys_path + describe 'User removes a key', :js do + shared_examples 'removes key' do + it 'removes key' do + visit path + click_button('Delete') - click_link('Remove') + page.within('.modal') do + page.click_button('Delete') + end - expect(page).to have_content('Your SSH keys (0)') - end + expect(page).to have_content('Your SSH keys (0)') + end + end - it 'User removes a key via its details page' do - key = create(:key, user: user) - visit profile_key_path(key) + context 'via the key index' do + before do + create(:key, user: user) + end + + let(:path) { profile_keys_path } - click_link('Remove') + it_behaves_like 'removes key' + end - expect(page).to have_content('Your SSH keys (0)') + context 'via its details page' do + let(:key) { create(:key, user: user) } + let(:path) { profile_keys_path(key) } + + it_behaves_like 'removes key' + end end end |