Consider disallowing N+1 query tests in controller specs
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Doing N+1 query tests in controller specs can be problematic as seen in https://gitlab.com/gitlab-org/gitlab-ce/issues/64116
From https://gitlab.com/gitlab-org/gitlab-ce/issues/64116#note_188387768: It is also better to do these kinds of tests in request / feature specs as it is more representative of behavior in production. For instance, I think ActiveRecord::QueryCache is not used in controller specs because it doesn't go through Rack middleware.
I'm not sure how we would enforce this though. Rubocop rule preventing use of QueryRecorder perhaps?
Edited by 🤖 GitLab Bot 🤖