mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:02:46 +08:00
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…
Reference in New Issue
Block a user