Add N+1 query specs for the snippet index actions
Several controllers rendering snippets require some relations to be preloaded to avoid N+1 queries. Currently, only one controller is covered by a controller spec.
Should we cover all of these controllers with a request-spec, perhaps using a shared example to work around this documented caveat when using controller specs for these kinds of tests.
The following discussion from !55452 (merged) should be addressed:
-
@reprazent started a discussion: (+3 comments) Should we add a shared example that we can use in the affected request specs that guards us against an N+1 queries? There's several things here already that are here to avoid that. But perhaps now is the time to finally guard against that, what do you think?
We can use the
QueryRecorder
for specs like that.