DEV: Fix flaky test due to a lack of deterministic ordering (#20087)
This commit is contained in:
parent
6934edd97c
commit
c5c72a74b7
|
@ -63,10 +63,13 @@ class TagsController < ::ApplicationController
|
||||||
unrestricted_tags = DiscourseTagging.filter_visible(tags.where(target_tag_id: nil), guardian)
|
unrestricted_tags = DiscourseTagging.filter_visible(tags.where(target_tag_id: nil), guardian)
|
||||||
|
|
||||||
categories =
|
categories =
|
||||||
Category.where(
|
Category
|
||||||
"id IN (SELECT category_id FROM category_tags WHERE category_id IN (?))",
|
.where(
|
||||||
guardian.allowed_category_ids,
|
"id IN (SELECT category_id FROM category_tags WHERE category_id IN (?))",
|
||||||
).includes(:none_synonym_tags)
|
guardian.allowed_category_ids,
|
||||||
|
)
|
||||||
|
.includes(:none_synonym_tags)
|
||||||
|
.order(:id)
|
||||||
|
|
||||||
category_tag_counts =
|
category_tag_counts =
|
||||||
categories
|
categories
|
||||||
|
|
|
@ -197,7 +197,7 @@ RSpec.describe TagsController do
|
||||||
expect(categories[0]["tags"][0]["target_tag"]).to eq(nil)
|
expect(categories[0]["tags"][0]["target_tag"]).to eq(nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
xit "does not result in N+1 queries when there are multiple categories configured with tags for an admin user" do
|
it "does not result in N+1 queries when there are multiple categories configured with tags for an admin user" do
|
||||||
category.update!(tags: [test_tag])
|
category.update!(tags: [test_tag])
|
||||||
|
|
||||||
sign_in(admin)
|
sign_in(admin)
|
||||||
|
|
Loading…
Reference in New Issue