diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /spec/features/profiles/keys_spec.rb | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'spec/features/profiles/keys_spec.rb')
-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 |