diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /spec/features/profiles | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/account_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index 620c2f60ba3..e8caa2159a4 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -9,6 +9,39 @@ RSpec.describe 'Profile > Account', :js do sign_in(user) end + describe 'Social sign-in' do + context 'when an identity does not exist' do + before do + allow(Devise).to receive_messages(omniauth_configs: { google_oauth2: {} }) + end + + it 'allows the user to connect' do + visit profile_account_path + + expect(page).to have_link('Connect Google', href: '/users/auth/google_oauth2') + end + end + + context 'when an identity already exists' do + before do + allow(Devise).to receive_messages(omniauth_configs: { twitter: {}, saml: {} }) + + create(:identity, user: user, provider: :twitter) + create(:identity, user: user, provider: :saml) + + visit profile_account_path + end + + it 'allows the user to disconnect when there is an existing identity' do + expect(page).to have_link('Disconnect Twitter', href: '/profile/account/unlink?provider=twitter') + end + + it 'shows active for a provider that is not allowed to unlink' do + expect(page).to have_content('Saml Active') + end + end + end + describe 'Change username' do let(:new_username) { 'bar' } let(:new_user_path) { "/#{new_username}" } |