Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix order-dependent mention lookup in notifications controller spec (#44083)

Gabriel Grubbae55e04897708
diff --git a/spec/requests/notifications_controller_spec.rb b/spec/requests/notifications_controller_spec.rb
index 10e58d9c460..cfb188c9532 100644
--- a/spec/requests/notifications_controller_spec.rb
+++ b/spec/requests/notifications_controller_spec.rb
@@ -515,7 +515,10 @@ RSpec.describe NotificationsController do
PostAlerter.post_created(post)
mention_notification =
- user.notifications.find_by!(notification_type: Notification.types[:mentioned])
+ user.notifications.find_by!(
+ notification_type: Notification.types[:mentioned],
+ topic: post.topic,
+ )
expect(mention_notification.data_hash[:display_name]).to eq(mentioner.name)
get "/notifications.json"