diff options
Diffstat (limited to 'spec/features/profiles')
23 files changed, 102 insertions, 39 deletions
diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index 82c45862e07..7e4308106be 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Account', :js, feature_category: :users do +RSpec.describe 'Profile > Account', :js, feature_category: :user_profile do let(:user) { create(:user, username: 'foo') } before do diff --git a/spec/features/profiles/active_sessions_spec.rb b/spec/features/profiles/active_sessions_spec.rb index 5c20735cf35..0de4ad47f9a 100644 --- a/spec/features/profiles/active_sessions_spec.rb +++ b/spec/features/profiles/active_sessions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state, feature_category: :users do +RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state, feature_category: :user_profile do include Spec::Support::Helpers::ModalHelpers let(:user) do diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb index 14fdb8ba56f..299ecdb6032 100644 --- a/spec/features/profiles/chat_names_spec.rb +++ b/spec/features/profiles/chat_names_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Chat', feature_category: :users do +RSpec.describe 'Profile > Chat', feature_category: :user_profile do let(:user) { create(:user) } let(:integration) { create(:integration) } diff --git a/spec/features/profiles/emails_spec.rb b/spec/features/profiles/emails_spec.rb index e8ea227c072..d00cef1f6f0 100644 --- a/spec/features/profiles/emails_spec.rb +++ b/spec/features/profiles/emails_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Emails', feature_category: :users do +RSpec.describe 'Profile > Emails', feature_category: :user_profile do let(:user) { create(:user) } let(:other_user) { create(:user) } diff --git a/spec/features/profiles/gpg_keys_spec.rb b/spec/features/profiles/gpg_keys_spec.rb index 1d014f983e7..0fc59f21489 100644 --- a/spec/features/profiles/gpg_keys_spec.rb +++ b/spec/features/profiles/gpg_keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > GPG Keys', feature_category: :users do +RSpec.describe 'Profile > GPG Keys', feature_category: :user_profile do let(:user) { create(:user, email: GpgHelpers::User2.emails.first) } before do diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index 7a2a12d8dca..ae61f1cf492 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > SSH Keys', feature_category: :users do +RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do let(:user) { create(:user) } before do @@ -76,35 +76,76 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :users do expect(page).to have_content(key.title) end + def destroy_key(path, action, confirmation_button) + visit path + + page.click_button(action) + + page.within('.modal') do + page.click_button(confirmation_button) + end + + expect(page).to have_content('Your SSH keys (0)') + end + describe 'User removes a key', :js do - shared_examples 'removes key' do - it 'removes key' do - visit path - find('[data-testid=remove-icon]').click + let!(:key) { create(:key, user: user) } - page.within('.modal') do - page.click_button('Delete') - end + context 'via the key index' do + it 'removes key' do + destroy_key(profile_keys_path, 'Remove', 'Delete') + end + end - expect(page).to have_content('Your SSH keys (0)') + context 'via its details page' do + it 'removes key' do + destroy_key(profile_keys_path(key), 'Remove', 'Delete') end end + end + + describe 'User revokes a key', :js do + context 'when a commit is signed using SSH key' do + let!(:project) { create(:project, :repository) } + let!(:key) { create(:key, user: user) } + let!(:commit) { project.commit('ssh-signed-commit') } + + let!(:signature) do + create(:ssh_signature, + project: project, + key: key, + key_fingerprint_sha256: key.fingerprint_sha256, + commit_sha: commit.sha) + end - context 'via the key index' do before do - create(:key, user: user) + project.add_developer(user) end - let(:path) { profile_keys_path } + it 'revoking the SSH key marks commits as unverified' do + visit project_commit_path(project, commit) + wait_for_all_requests - it_behaves_like 'removes key' - end + find('a.signature-badge', text: 'Verified').click - context 'via its details page' do - let(:key) { create(:key, user: user) } - let(:path) { profile_keys_path(key) } + within('.popover') do + expect(page).to have_content("Verified commit") + expect(page).to have_content("SSH key fingerprint: #{key.fingerprint_sha256}") + end + + destroy_key(profile_keys_path, 'Revoke', 'Revoke') + + visit project_commit_path(project, commit) + wait_for_all_requests - it_behaves_like 'removes key' + find('a.signature-badge', text: 'Unverified').click + + within('.popover') do + expect(page).to have_content("Unverified signature") + expect(page).to have_content('This commit was signed with a key that was revoked.') + expect(page).to have_content("SSH key fingerprint: #{signature.key_fingerprint_sha256}") + end + end end end end diff --git a/spec/features/profiles/list_users_saved_replies_spec.rb b/spec/features/profiles/list_users_saved_replies_spec.rb new file mode 100644 index 00000000000..4f3678f8051 --- /dev/null +++ b/spec/features/profiles/list_users_saved_replies_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Profile > Notifications > List users saved replies', :js, + feature_category: :user_profile do + let_it_be(:user) { create(:user) } + let_it_be(:saved_reply) { create(:saved_reply, user: user) } + + before do + sign_in(user) + end + + it 'shows the user a list of their saved replies' do + visit profile_saved_replies_path + + expect(page).to have_content('My saved replies (1)') + expect(page).to have_content(saved_reply.name) + expect(page).to have_content(saved_reply.content) + end +end diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb index 80d05fd5cc7..d088f73f9df 100644 --- a/spec/features/profiles/oauth_applications_spec.rb +++ b/spec/features/profiles/oauth_applications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Applications', feature_category: :users do +RSpec.describe 'Profile > Applications', feature_category: :user_profile do include Spec::Support::Helpers::ModalHelpers let(:user) { create(:user) } diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index b324ee17873..c0c573d2f20 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Password', feature_category: :users do +RSpec.describe 'Profile > Password', feature_category: :user_profile do let(:user) { create(:user) } def fill_passwords(password, confirmation) diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 3087d7ff296..a050e87241b 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Personal Access Tokens', :js, feature_category: :users do +RSpec.describe 'Profile > Personal Access Tokens', :js, feature_category: :user_profile do include Spec::Support::Helpers::ModalHelpers include Spec::Support::Helpers::AccessTokenHelpers diff --git a/spec/features/profiles/two_factor_auths_spec.rb b/spec/features/profiles/two_factor_auths_spec.rb index 8dddaad11c3..e8ff8416722 100644 --- a/spec/features/profiles/two_factor_auths_spec.rb +++ b/spec/features/profiles/two_factor_auths_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Two factor auths', feature_category: :users do +RSpec.describe 'Two factor auths', feature_category: :user_profile do include Spec::Support::Helpers::ModalHelpers context 'when signed in' do diff --git a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb index 197a33c355d..89887cb4772 100644 --- a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb +++ b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Profile > Notifications > User changes notified_of_own_activity setting', :js, -feature_category: :users do +feature_category: :user_profile do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_edit_preferences_spec.rb b/spec/features/profiles/user_edit_preferences_spec.rb index 1a231f1d269..f7a9850355a 100644 --- a/spec/features/profiles/user_edit_preferences_spec.rb +++ b/spec/features/profiles/user_edit_preferences_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User edit preferences profile', :js, feature_category: :users do +RSpec.describe 'User edit preferences profile', :js, feature_category: :user_profile do include StubLanguagesTranslationPercentage # Empty value doesn't change the levels diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index 67604292090..3819723cc09 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User edit profile', feature_category: :users do +RSpec.describe 'User edit profile', feature_category: :user_profile do include Spec::Support::Helpers::Features::NotesHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/profiles/user_manages_applications_spec.rb b/spec/features/profiles/user_manages_applications_spec.rb index 179da61b8ed..e3c4a797431 100644 --- a/spec/features/profiles/user_manages_applications_spec.rb +++ b/spec/features/profiles/user_manages_applications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User manages applications', feature_category: :users do +RSpec.describe 'User manages applications', feature_category: :user_profile do let_it_be(:user) { create(:user) } let_it_be(:new_application_path) { applications_profile_path } let_it_be(:index_path) { oauth_applications_path } diff --git a/spec/features/profiles/user_manages_emails_spec.rb b/spec/features/profiles/user_manages_emails_spec.rb index 16a9fbc2f47..b875dfec217 100644 --- a/spec/features/profiles/user_manages_emails_spec.rb +++ b/spec/features/profiles/user_manages_emails_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User manages emails', feature_category: :users do +RSpec.describe 'User manages emails', feature_category: :user_profile do let(:user) { create(:user) } let(:other_user) { create(:user) } diff --git a/spec/features/profiles/user_search_settings_spec.rb b/spec/features/profiles/user_search_settings_spec.rb index 09ee8ddeaab..932ea11075a 100644 --- a/spec/features/profiles/user_search_settings_spec.rb +++ b/spec/features/profiles/user_search_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User searches their settings', :js, feature_category: :users do +RSpec.describe 'User searches their settings', :js, feature_category: :user_profile do let_it_be(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_visits_notifications_tab_spec.rb b/spec/features/profiles/user_visits_notifications_tab_spec.rb index d212982f4e3..1295a0b6150 100644 --- a/spec/features/profiles/user_visits_notifications_tab_spec.rb +++ b/spec/features/profiles/user_visits_notifications_tab_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User visits the notifications tab', :js, feature_category: :users do +RSpec.describe 'User visits the notifications tab', :js, feature_category: :user_profile do let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/features/profiles/user_visits_profile_account_page_spec.rb b/spec/features/profiles/user_visits_profile_account_page_spec.rb index 1cf34478ecf..8ff9cbc242e 100644 --- a/spec/features/profiles/user_visits_profile_account_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_account_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User visits the profile account page', feature_category: :users do +RSpec.describe 'User visits the profile account page', feature_category: :user_profile do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_visits_profile_authentication_log_spec.rb b/spec/features/profiles/user_visits_profile_authentication_log_spec.rb index 726cca4a4bd..90f24c5b866 100644 --- a/spec/features/profiles/user_visits_profile_authentication_log_spec.rb +++ b/spec/features/profiles/user_visits_profile_authentication_log_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User visits the authentication log', feature_category: :users do +RSpec.describe 'User visits the authentication log', feature_category: :user_profile do let(:user) { create(:user) } context 'when user signed in' do diff --git a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb index e3940973c46..d690589b893 100644 --- a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User visits the profile preferences page', :js, feature_category: :users do +RSpec.describe 'User visits the profile preferences page', :js, feature_category: :user_profile do include ListboxHelpers let(:user) { create(:user) } diff --git a/spec/features/profiles/user_visits_profile_spec.rb b/spec/features/profiles/user_visits_profile_spec.rb index 7fca0f24deb..ad265fbae9e 100644 --- a/spec/features/profiles/user_visits_profile_spec.rb +++ b/spec/features/profiles/user_visits_profile_spec.rb @@ -2,10 +2,11 @@ require 'spec_helper' -RSpec.describe 'User visits their profile', feature_category: :users do +RSpec.describe 'User visits their profile', feature_category: :user_profile do let_it_be_with_refind(:user) { create(:user) } before do + stub_feature_flags(profile_tabs_vue: false) sign_in(user) end diff --git a/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb index 8467e9abeaf..547e47ead77 100644 --- a/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User visits the profile SSH keys page', feature_category: :users do +RSpec.describe 'User visits the profile SSH keys page', feature_category: :user_profile do let(:user) { create(:user) } before do |