summaryrefslogtreecommitdiff
path: root/spec/features/admin
diff options
context:
space:
mode:
authorPavel Forkert <fxposter@gmail.com>2015-09-24 16:14:16 +0300
committerPavel Forkert <fxposter@gmail.com>2015-09-24 16:14:16 +0300
commit83347954fc3c0c317c77f0528cdbaa456093771a (patch)
treeb9d2a290f762270b11c3753853b7d7584c1966c1 /spec/features/admin
parentf2999fe8f3709775ea2151fa3dcd7c456267edb2 (diff)
downloadgitlab-ce-83347954fc3c0c317c77f0528cdbaa456093771a.tar.gz
Add option to admin area to sign in as a specific user
Closes #2291
Diffstat (limited to 'spec/features/admin')
-rw-r--r--spec/features/admin/admin_users_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 86717761582..870a82d0ee0 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -166,4 +166,20 @@ describe "Admin::Users", feature: true do
end
end
end
+
+ it 'should be able to log in as another user' do
+ another_user = create(:user)
+
+ visit admin_users_path
+
+ page.within ".user-#{another_user.id}" do
+ click_link 'Log in'
+ end
+
+ 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
end