Merge branch 'fix-impersonation-log' into 'master'
Fix incorrect "stopped impersonation" log message Minor bug: Usernames were swapped in the log message. Closes #21015 See merge request !5949
This commit is contained in:
commit
d716492a02
2 changed files with 3 additions and 1 deletions
|
@ -7,7 +7,7 @@ class Admin::ImpersonationsController < Admin::ApplicationController
|
||||||
|
|
||||||
warden.set_user(impersonator, scope: :user)
|
warden.set_user(impersonator, scope: :user)
|
||||||
|
|
||||||
Gitlab::AppLogger.info("User #{original_user.username} has stopped impersonating #{impersonator.username}")
|
Gitlab::AppLogger.info("User #{impersonator.username} has stopped impersonating #{original_user.username}")
|
||||||
|
|
||||||
session[:impersonator_id] = nil
|
session[:impersonator_id] = nil
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,8 @@ describe Admin::ImpersonationsController do
|
||||||
|
|
||||||
context "when the impersonator is not blocked" do
|
context "when the impersonator is not blocked" do
|
||||||
it "redirects to the impersonated user's page" do
|
it "redirects to the impersonated user's page" do
|
||||||
|
expect(Gitlab::AppLogger).to receive(:info).with("User #{impersonator.username} has stopped impersonating #{user.username}").and_call_original
|
||||||
|
|
||||||
delete :destroy
|
delete :destroy
|
||||||
|
|
||||||
expect(response).to redirect_to(admin_user_path(user))
|
expect(response).to redirect_to(admin_user_path(user))
|
||||||
|
|
Loading…
Reference in a new issue