mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
DEV: Restore order assertion in category serializer tests. (#16344)
Our group fabrication creates groups with name "my_group_#{n}" where n is the sequence number of the group being created. However, this can cause the test to be flaky if and when a group with name `my_group_10` is created as it will be ordered before `my_group_9`. This commits makes the group names determinstic to eliminate any flakiness. This reverts commit 558bc6b746928a1fcdb2773b0447ea4a57aa7419.
This commit is contained in:

committed by
GitHub

parent
4b93dba82f
commit
e7c3d01aaa
@ -142,7 +142,7 @@ class Group < ActiveRecord::Base
|
||||
scope :with_smtp_configured, -> { where(smtp_enabled: true) }
|
||||
|
||||
scope :visible_groups, Proc.new { |user, order, opts|
|
||||
groups = self.order(order || "name ASC")
|
||||
groups = self.order(order || "groups.name ASC")
|
||||
|
||||
if !opts || !opts[:include_everyone]
|
||||
groups = groups.where("groups.id > 0")
|
||||
|
Reference in New Issue
Block a user