DEV: makes test more deterministic (#20078)
`last_message_sent_at` could be equal and as a result the order would be random causing random spec failures in plugins/chat/spec/mailers/user_notifications_spec.rb:182
This commit is contained in:
parent
a4c32e3970
commit
06ad13b517
|
@ -69,7 +69,10 @@ module Chat::UserNotificationsExtension
|
||||||
|
|
||||||
# Prioritize messages from regular channels over direct messages
|
# Prioritize messages from regular channels over direct messages
|
||||||
if channels.any?
|
if channels.any?
|
||||||
channel_notification_text(channels.sort_by(&:last_message_sent_at), dm_users)
|
channel_notification_text(
|
||||||
|
channels.sort_by { |channel| [channel.last_message_sent_at, channel.created_at] },
|
||||||
|
dm_users,
|
||||||
|
)
|
||||||
else
|
else
|
||||||
direct_message_notification_text(dm_users)
|
direct_message_notification_text(dm_users)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue