Stabilize notifications tray test ordering via fixture updated_at timestamps

This commit is contained in:
Alp Keser
2026-02-16 18:33:32 +03:00
parent bcc0f93bb9
commit a48c88cb5d
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ class Notification < ApplicationRecord
scope :unread, -> { where(read_at: nil) } scope :unread, -> { where(read_at: nil) }
scope :read, -> { where.not(read_at: nil) } scope :read, -> { where.not(read_at: nil) }
scope :ordered, -> { order(read_at: :desc, updated_at: :desc, id: :desc) } scope :ordered, -> { order(read_at: :desc, updated_at: :desc) }
scope :preloaded, -> { scope :preloaded, -> {
preload( preload(
:creator, :account, :creator, :account,
+3
View File
@@ -5,6 +5,7 @@ logo_assignment_kevin:
card: logo_uuid card: logo_uuid
unread_count: 2 unread_count: 2
created_at: <%= 1.week.ago %> created_at: <%= 1.week.ago %>
updated_at: <%= 1.week.ago + 1.second %>
creator: david_uuid creator: david_uuid
account: 37s_uuid account: 37s_uuid
@@ -15,6 +16,7 @@ layout_commented_kevin:
card: layout_uuid card: layout_uuid
unread_count: 1 unread_count: 1
created_at: <%= 1.week.ago %> created_at: <%= 1.week.ago %>
updated_at: <%= 1.week.ago + 2.seconds %>
creator: david_uuid creator: david_uuid
account: 37s_uuid account: 37s_uuid
@@ -25,5 +27,6 @@ logo_mentioned_david:
card: logo_uuid card: logo_uuid
unread_count: 2 unread_count: 2
created_at: <%= 1.week.ago %> created_at: <%= 1.week.ago %>
updated_at: <%= 1.week.ago + 3.seconds %>
creator: david_uuid creator: david_uuid
account: 37s_uuid account: 37s_uuid