Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
45d4bdab
Commit
45d4bdab
authored
Feb 05, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch Devise::Test::ControllerHelpers#sign_in to sign-out first
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
1e82af42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
spec/support/helpers/controller_helpers.rb
spec/support/helpers/controller_helpers.rb
+18
-0
No files found.
spec/support/helpers/controller_helpers.rb
0 → 100644
View file @
45d4bdab
# frozen_string_literal: true
module
ControllerHelpers
# It seems Devise::Test::ControllerHelpers#sign_in doesn't clear out the @current_user
# variable of the controller, hence it's not overwritten on retries.
# This should be fixed in Devise:
# - https://github.com/heartcombo/devise/issues/5190
# - https://github.com/heartcombo/devise/pull/5191
def
sign_in
(
resource
,
deprecated
=
nil
,
scope:
nil
)
super
scope
||=
Devise
::
Mapping
.
find_scope!
(
resource
)
@controller
.
instance_variable_set
(
:"@current_
#{
scope
}
"
,
nil
)
end
end
Devise
::
Test
::
ControllerHelpers
.
prepend
(
ControllerHelpers
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment