diff options
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/account_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/profiles/chat_names_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/gpg_keys_spec.rb | 58 | ||||
-rw-r--r-- | spec/features/profiles/keys_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/oauth_applications_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/password_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/personal_access_tokens_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/preferences_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/user_changes_notified_of_own_activity_spec.rb | 2 |
9 files changed, 69 insertions, 11 deletions
diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index 9d782ecf63b..56c1f7ae9c7 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -feature 'Profile > Account', feature: true do +feature 'Profile > Account' do given(:user) { create(:user, username: 'foo') } before do @@ -27,7 +27,7 @@ feature 'Profile > Account', feature: true do end context 'with a project' do - given!(:project) { create(:project, namespace: user.namespace, path: 'project') } + given!(:project) { create(:empty_project, namespace: user.namespace) } given(:new_project_path) { "/#{new_username}/#{project.path}" } given(:old_project_path) { "/#{user.username}/#{project.path}" } @@ -43,14 +43,14 @@ feature 'Profile > Account', feature: true do update_username(new_username) visit new_project_path expect(current_path).to eq(new_project_path) - expect(find('h1.project-title')).to have_content(project.name) + expect(find('h1.title')).to have_content(project.path) end scenario 'the old project path redirects to the new path' do update_username(new_username) visit old_project_path expect(current_path).to eq(new_project_path) - expect(find('h1.project-title')).to have_content(project.name) + expect(find('h1.title')).to have_content(project.path) end end end diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb index e4c236f4c68..35793539e0e 100644 --- a/spec/features/profiles/chat_names_spec.rb +++ b/spec/features/profiles/chat_names_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -feature 'Profile > Chat', feature: true do +feature 'Profile > Chat' do given(:user) { create(:user) } given(:service) { create(:service) } diff --git a/spec/features/profiles/gpg_keys_spec.rb b/spec/features/profiles/gpg_keys_spec.rb new file mode 100644 index 00000000000..6edc482b47e --- /dev/null +++ b/spec/features/profiles/gpg_keys_spec.rb @@ -0,0 +1,58 @@ +require 'rails_helper' + +feature 'Profile > GPG Keys' do + let(:user) { create(:user, email: GpgHelpers::User2.emails.first) } + + before do + login_as(user) + end + + describe 'User adds a key' do + before do + visit profile_gpg_keys_path + end + + scenario 'saves the new key' do + fill_in('Key', with: GpgHelpers::User2.public_key) + click_button('Add key') + + expect(page).to have_content('bette.cartwright@example.com Verified') + expect(page).to have_content('bette.cartwright@example.net Unverified') + expect(page).to have_content(GpgHelpers::User2.fingerprint) + end + end + + scenario 'User sees their key' do + create(:gpg_key, user: user, key: GpgHelpers::User2.public_key) + visit profile_gpg_keys_path + + expect(page).to have_content('bette.cartwright@example.com Verified') + expect(page).to have_content('bette.cartwright@example.net Unverified') + expect(page).to have_content(GpgHelpers::User2.fingerprint) + end + + scenario 'User removes a key via the key index' do + create(:gpg_key, user: user, key: GpgHelpers::User2.public_key) + visit profile_gpg_keys_path + + click_link('Remove') + + expect(page).to have_content('Your GPG keys (0)') + end + + scenario 'User revokes a key via the key index' do + gpg_key = create :gpg_key, user: user, key: GpgHelpers::User2.public_key + gpg_signature = create :gpg_signature, gpg_key: gpg_key, valid_signature: true + + visit profile_gpg_keys_path + + click_link('Revoke') + + expect(page).to have_content('Your GPG keys (0)') + + expect(gpg_signature.reload).to have_attributes( + valid_signature: false, + gpg_key: nil + ) + end +end diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index 9439a258a75..6541ea6bf57 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -feature 'Profile > SSH Keys', feature: true do +feature 'Profile > SSH Keys' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb index c7886421c83..45f78444362 100644 --- a/spec/features/profiles/oauth_applications_spec.rb +++ b/spec/features/profiles/oauth_applications_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Profile > Applications', feature: true do +describe 'Profile > Applications' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 26d6d6658aa..2c757f99a27 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Profile > Password', feature: true do +describe 'Profile > Password' do context 'Password authentication enabled' do let(:user) { create(:user, password_automatically_set: true) } diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 3c08b6bc091..f3124bbf29e 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Profile > Personal Access Tokens', feature: true, js: true do +describe 'Profile > Personal Access Tokens', js: true do let(:user) { create(:user) } def active_personal_access_tokens diff --git a/spec/features/profiles/preferences_spec.rb b/spec/features/profiles/preferences_spec.rb index 65fed82c256..9123aa9d155 100644 --- a/spec/features/profiles/preferences_spec.rb +++ b/spec/features/profiles/preferences_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Profile > Preferences', feature: true do +describe 'Profile > Preferences' do let(:user) { create(:user) } before 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 75daef0c38c..6a4173d43e1 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 @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Profile > Notifications > User changes notified_of_own_activity setting', feature: true, js: true do +feature 'Profile > Notifications > User changes notified_of_own_activity setting', js: true do let(:user) { create(:user) } before do |