summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-07-23 13:02:58 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-07-23 13:02:58 +0000
commita9c7bda8f6f63c774bf723aeaefa47e98ccdfb2a (patch)
treea932dbffdfc0bd9044181b2a1e267c267d60ec36 /spec
parent825e5c2c1b1cd98f3daf99f22fea910f075f48f9 (diff)
parent3c9d75e045c94e25a53e78257b47c938f9c538a2 (diff)
downloadgitlab-ce-a9c7bda8f6f63c774bf723aeaefa47e98ccdfb2a.tar.gz
Merge branch 'ce-port-315-log-impersonation-actions-in-audit-log' into 'master'
CE Port: Log impersonation actions in audit log See merge request gitlab-org/gitlab-ce!31039
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/admin/users_controller_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb
index 89a0eba66f7..d7428f8b52c 100644
--- a/spec/controllers/admin/users_controller_spec.rb
+++ b/spec/controllers/admin/users_controller_spec.rb
@@ -279,6 +279,12 @@ describe Admin::UsersController do
expect(warden.user).to eq(user)
end
+ it 'logs the beginning of the impersonation event' do
+ expect(Gitlab::AppLogger).to receive(:info).with("User #{admin.username} has started impersonating #{user.username}").and_call_original
+
+ post :impersonate, params: { id: user.username }
+ end
+
it "redirects to root" do
post :impersonate, params: { id: user.username }