From a48c88cb5d6e35bd2000744589dfe085c8dc5385 Mon Sep 17 00:00:00 2001 From: Alp Keser Date: Mon, 16 Feb 2026 18:33:32 +0300 Subject: [PATCH] Stabilize notifications tray test ordering via fixture updated_at timestamps --- app/models/notification.rb | 2 +- test/fixtures/notifications.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index 2d868674c..417a2f22d 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -9,7 +9,7 @@ class Notification < ApplicationRecord scope :unread, -> { where(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, -> { preload( :creator, :account, diff --git a/test/fixtures/notifications.yml b/test/fixtures/notifications.yml index b7ae167cd..8fa4404d5 100644 --- a/test/fixtures/notifications.yml +++ b/test/fixtures/notifications.yml @@ -5,6 +5,7 @@ logo_assignment_kevin: card: logo_uuid unread_count: 2 created_at: <%= 1.week.ago %> + updated_at: <%= 1.week.ago + 1.second %> creator: david_uuid account: 37s_uuid @@ -15,6 +16,7 @@ layout_commented_kevin: card: layout_uuid unread_count: 1 created_at: <%= 1.week.ago %> + updated_at: <%= 1.week.ago + 2.seconds %> creator: david_uuid account: 37s_uuid @@ -25,5 +27,6 @@ logo_mentioned_david: card: logo_uuid unread_count: 2 created_at: <%= 1.week.ago %> + updated_at: <%= 1.week.ago + 3.seconds %> creator: david_uuid account: 37s_uuid