DEV: Fix flaky specs by explicitly ordering tags (#20097)

This commit is contained in:
Gerhard Schlager 2023-01-31 14:38:42 +01:00 committed by GitHub
parent 06817bd94f
commit fe4a71848e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class TagsController < ::ApplicationController
if SiteSetting.tags_listed_by_group if SiteSetting.tags_listed_by_group
ungrouped_tags = Tag.where("tags.id NOT IN (SELECT tag_id FROM tag_group_memberships)") ungrouped_tags = Tag.where("tags.id NOT IN (SELECT tag_id FROM tag_group_memberships)")
ungrouped_tags = ungrouped_tags.used_tags_in_regular_topics(guardian) unless show_all_tags ungrouped_tags = ungrouped_tags.used_tags_in_regular_topics(guardian) unless show_all_tags
ungrouped_tags = ungrouped_tags.order(:id)
grouped_tag_counts = grouped_tag_counts =
TagGroup TagGroup
@ -60,6 +61,7 @@ class TagsController < ::ApplicationController
@extras = { tag_groups: grouped_tag_counts } @extras = { tag_groups: grouped_tag_counts }
else else
tags = show_all_tags ? Tag.all : Tag.used_tags_in_regular_topics(guardian) tags = show_all_tags ? Tag.all : Tag.used_tags_in_regular_topics(guardian)
tags = tags.order(:id)
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 =