diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-06-25 16:19:06 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-06-29 12:18:23 -0400 |
commit | 310845cfd57eeda936ff8e130cc9553ade919a68 (patch) | |
tree | 875ee86ba144ff82f920e13b103fb0a0b57af391 /spec | |
parent | 204f4c5c15432f048d630dc2402d820cb83f0e08 (diff) | |
download | gitlab-ce-310845cfd57eeda936ff8e130cc9553ade919a68.tar.gz |
Remove instance variable assignment from `gitlab_sign_in` helperrs-sign_in
Also removes `Thread.current[:current_user]` assignment from
`gitlab_sign_in_via`
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/login_helpers.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index aa3b7c7bb84..47278595958 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -15,14 +15,16 @@ module LoginHelpers # user = create(:user) # gitlab_sign_in(user) def gitlab_sign_in(user_or_role, **kwargs) - @user = + user = if user_or_role.is_a?(User) user_or_role else create(user_or_role) end - gitlab_sign_in_with(@user, **kwargs) + gitlab_sign_in_with(user, **kwargs) + + user end def gitlab_sign_in_via(provider, user, uid) @@ -53,8 +55,6 @@ module LoginHelpers check 'user_remember_me' if remember click_button "Sign in" - - Thread.current[:current_user] = user end def mock_auth_hash(provider, uid, email) |