From 4f33b041f090c0044374ff89c8e6a3db36f35361 Mon Sep 17 00:00:00 2001
From: Claire <claire.github-309c@sitedethib.com>
Date: Wed, 29 Jan 2025 13:49:03 +0100
Subject: [PATCH] Fix flaky test in `/api/v2/notifications` tests (#33773)

---
 spec/requests/api/v2/notifications_spec.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/spec/requests/api/v2/notifications_spec.rb b/spec/requests/api/v2/notifications_spec.rb
index aa4a86155..b2f6d71b5 100644
--- a/spec/requests/api/v2/notifications_spec.rb
+++ b/spec/requests/api/v2/notifications_spec.rb
@@ -153,7 +153,7 @@ RSpec.describe 'Notifications' do
         it 'returns a notification group covering all notifications' do
           subject
 
-          notification_ids = user.account.notifications.reload.pluck(:id)
+          notification_ids = user.account.notifications.order(id: :asc).pluck(:id)
 
           expect(response).to have_http_status(200)
           expect(response.content_type)
@@ -175,7 +175,7 @@ RSpec.describe 'Notifications' do
         it 'returns a notification group covering all notifications' do
           subject
 
-          notification_ids = user.account.notifications.reload.pluck(:id)
+          notification_ids = user.account.notifications.order(id: :asc).pluck(:id)
 
           expect(response).to have_http_status(200)
           expect(response.content_type)