mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 11:05:45 +08:00
DEV: Fix spec (#26226)
Follow up to commit a90b88af5618b99496ab14d8c6264785484e1f84.
This commit is contained in:
parent
4e02bb5dd9
commit
d78657bf9b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user