Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear User.current after controller actions #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Clear User.current after controller actions #13

wants to merge 1 commit into from

Conversation

sammyhenningsson
Copy link

Tests suites might get flaky when User.current is not cleanup after tests

In the "normal" Rails request/response lifecycle it's not needed to clear User.current after a request has been processed (since it will reset on each new request). However, in tests this not the case. If we have an integration/system test that sets User.current and then afterwards we run a non-controller test (e.g. a background job test etc) we get unexpected behavior.

Copy link

@pean pean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, I've been adding workarounds in test suites for this that I really looking forward to removing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants