DEV: Fix spec (#26226)

Follow up to commit a90b88af56.
This commit is contained in:
Bianca Nenciu 2024-03-18 20:05:56 +02:00 committed by GitHub
parent 4e02bb5dd9
commit d78657bf9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1152,10 +1152,13 @@ RSpec.describe CategoriesController do
[category, category2, subcategory].each { |c| SearchIndexer.index(c, force: true) }
end
it "does not generate N+1s" do
it "does not generate N+1 queries" do
# Warm up caches
get "/categories/search.json", params: { term: "Foo" }
queries = track_sql_queries { get "/categories/search.json", params: { term: "Foo" } }
expect(queries.length).to eq(6)
expect(queries.length).to eq(4)
end
context "without include_ancestors" do