sentient_user icon indicating copy to clipboard operation
sentient_user copied to clipboard

Clear User.current after controller actions

Open sammyhenningsson opened this issue 7 years ago • 0 comments

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.

sammyhenningsson avatar Nov 13 '18 14:11 sammyhenningsson