diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-07 15:15:35 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-07 15:15:35 +0200 |
commit | 4f629dab2a14c190b641bd709c28ebdad5b7a062 (patch) | |
tree | 00035d114b896a38b4a2a6ac835411ba36d3e1e5 /spec/features/admin/admin_users_spec.rb | |
parent | 48837850838c8acb0c02ae60b29e18d287865878 (diff) | |
parent | 0611a18964a998b6edc81ef9b469f9f70430e542 (diff) | |
download | gitlab-ce-4f629dab2a14c190b641bd709c28ebdad5b7a062.tar.gz |
Merge branch 'master' into rs-redactor-filter
Diffstat (limited to 'spec/features/admin/admin_users_spec.rb')
-rw-r--r-- | spec/features/admin/admin_users_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 86717761582..c2c7364f6c5 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -111,6 +111,27 @@ describe "Admin::Users", feature: true do expect(page).to have_content(@user.name) end + describe 'Login as another user' do + it 'should show login button for other users and check that it works' do + another_user = create(:user) + + visit admin_user_path(another_user) + + click_link 'Log in as this user' + + expect(page).to have_content("Logged in as #{another_user.username}") + + page.within '.sidebar-user .username' do + expect(page).to have_content(another_user.username) + end + end + + it 'should not show login button for admin itself' do + visit admin_user_path(@user) + expect(page).not_to have_content('Log in as this user') + end + end + describe 'Two-factor Authentication status' do it 'shows when enabled' do @user.update_attribute(:two_factor_enabled, true) |