diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-23 14:24:16 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-23 14:24:16 +0000 |
commit | 94f130cbfc0349c1b17d4882e7d5c367030b21d1 (patch) | |
tree | a6c0258c256bece75fc5a5fcecc4fa2f74daed2a /features | |
parent | b51fe6831123830f729295e16bd5aa99e3012c57 (diff) | |
parent | 4acd1f5d6a1942d4348b5d94e278fdb25c29e532 (diff) | |
download | gitlab-ce-94f130cbfc0349c1b17d4882e7d5c367030b21d1.tar.gz |
Merge branch 'admin-edit-identities' into 'master'
Admin can see, edit and remove user identities
Related to #1415 and https://dev.gitlab.org/gitlab/gitlabhq/issues/2224
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !843
Diffstat (limited to 'features')
-rw-r--r-- | features/admin/users.feature | 20 | ||||
-rw-r--r-- | features/steps/admin/users.rb | 41 |
2 files changed, 60 insertions, 1 deletions
diff --git a/features/admin/users.feature b/features/admin/users.feature index 1a8720dd77e..6755645778a 100644 --- a/features/admin/users.feature +++ b/features/admin/users.feature @@ -28,7 +28,7 @@ Feature: Admin Users When I submit modified user Then I see user attributes changed -@javascript + @javascript Scenario: Remove users secondary email Given I visit admin users page And I view the user with secondary email @@ -40,8 +40,26 @@ Feature: Admin Users Given user "Pete" with ssh keys And I visit admin users page And click on user "Pete" + And click on ssh keys tab Then I should see key list And I click on the key title Then I should see key details And I click on remove key Then I should see the key removed + + Scenario: Show user identities + Given user "Pete" with twitter account + And I visit "Pete" identities page in admin + Then I should see twitter details + + Scenario: Update user identities + Given user "Pete" with twitter account + And I visit "Pete" identities page in admin + And I modify twitter identity + Then I should see twitter details updated + + Scenario: Remove user identities + Given user "Pete" with twitter account + And I visit "Pete" identities page in admin + And I remove twitter identity + Then I should not see twitter details diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb index 34a3ed9f615..6c4b91586d6 100644 --- a/features/steps/admin/users.rb +++ b/features/steps/admin/users.rb @@ -114,4 +114,45 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps step 'I should see the key removed' do expect(page).not_to have_content 'ssh-rsa Key2' end + + step 'user "Pete" with twitter account' do + @user = create(:user, name: 'Pete') + @user.identities.create!(extern_uid: '123456', provider: 'twitter') + end + + step 'I visit "Pete" identities page in admin' do + allow(Gitlab::OAuth::Provider).to receive(:names).and_return(%w(twitter twitter_updated)) + visit admin_user_identities_path(@user) + end + + step 'I should see twitter details' do + expect(page).to have_content 'Pete' + expect(page).to have_content 'twitter' + end + + step 'I modify twitter identity' do + find('.table').find(:link, 'Edit').click + fill_in 'identity_extern_uid', with: '654321' + select 'twitter_updated', from: 'identity_provider' + click_button 'Save changes' + end + + step 'I should see twitter details updated' do + expect(page).to have_content 'Pete' + expect(page).to have_content 'twitter_updated' + expect(page).to have_content '654321' + end + + step 'I remove twitter identity' do + click_link 'Delete' + end + + step 'I should not see twitter details' do + expect(page).to have_content 'Pete' + expect(page).to_not have_content 'twitter' + end + + step 'click on ssh keys tab' do + click_link 'SSH keys' + end end |