Sometimes spec which is testing order groups by user count is failing - line 141
My theory is that cause is the randomness of Postgres when the order value is the same for 2 rows.
In spec, we got three groups
moderator_group - 0 users
group - 1 user
other_group - 1 user
And we are expecting that controller will return them in ascending order [moderator, group, other_group]
other_group contain the same amount of users, we are dealing with luck
Therefore, I believe that adding one more user to other_group should make that query reliable.
After adding a user to other_group, I needed to change the order in another spec which was testing DESC order of groups.
It was not crashing on my local machine, so I am not 100% sure.