Skip to content

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