chore: Delete related notifications if a conversation is deleted (#2592)
This commit is contained in:
@@ -399,4 +399,15 @@ RSpec.describe Conversation, type: :model do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#delete conversation' do
|
||||
let!(:conversation) { create(:conversation) }
|
||||
|
||||
let!(:notification) { create(:notification, notification_type: 'conversation_creation', primary_actor: conversation) }
|
||||
|
||||
it 'delete associated notifications if conversation is deleted' do
|
||||
conversation.destroy
|
||||
expect { notification.reload }.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user