DEV: Skip notifications without topic_id in ensure_consistency (#16299)

This commit is contained in:
Mark VanLandingham
2022-03-30 09:56:35 -05:00
committed by GitHub
parent 2e77cc86fc
commit b974375239
2 changed files with 3 additions and 4 deletions

View File

@@ -340,10 +340,9 @@ describe Notification do
expect(Notification.count).to eq(2)
end
it 'does not delete chat_message notifications' do
it 'does not delete notifications that do not have a topic_id' do
Notification.create!(read: false, user_id: user.id, topic_id: nil, post_number: nil, data: '[]',
notification_type: Notification.types[:chat_mention])
notification_type: Notification.types[:chat_mention], high_priority: true)
expect {
Notification.ensure_consistency!
}.to_not change { Notification.count }