Commit 310845cf authored by Robert Speicher's avatar Robert Speicher

Remove instance variable assignment from `gitlab_sign_in` helper

Also removes `Thread.current[:current_user]` assignment from
`gitlab_sign_in_via`
parent 204f4c5c
...@@ -15,14 +15,16 @@ module LoginHelpers ...@@ -15,14 +15,16 @@ module LoginHelpers
# user = create(:user) # user = create(:user)
# gitlab_sign_in(user) # gitlab_sign_in(user)
def gitlab_sign_in(user_or_role, **kwargs) def gitlab_sign_in(user_or_role, **kwargs)
@user = user =
if user_or_role.is_a?(User) if user_or_role.is_a?(User)
user_or_role user_or_role
else else
create(user_or_role) create(user_or_role)
end end
gitlab_sign_in_with(@user, **kwargs) gitlab_sign_in_with(user, **kwargs)
user
end end
def gitlab_sign_in_via(provider, user, uid) def gitlab_sign_in_via(provider, user, uid)
...@@ -53,8 +55,6 @@ module LoginHelpers ...@@ -53,8 +55,6 @@ module LoginHelpers
check 'user_remember_me' if remember check 'user_remember_me' if remember
click_button "Sign in" click_button "Sign in"
Thread.current[:current_user] = user
end end
def mock_auth_hash(provider, uid, email) def mock_auth_hash(provider, uid, email)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment