chore: Fix issues with notification actors (#1807)

This commit is contained in:
Sojan Jose
2021-02-19 18:35:21 +05:30
committed by GitHub
parent eec90a1319
commit 1612f515b0
6 changed files with 23 additions and 16 deletions

View File

@@ -34,9 +34,11 @@ RSpec.describe Notification do
end
it 'returns appropriate title suited for the notification type assigned_conversation_new_message' do
notification = create(:notification, notification_type: 'assigned_conversation_new_message')
message = create(:message, sender: create(:user), content: Faker::Lorem.paragraphs(number: 2))
notification = create(:notification, notification_type: 'assigned_conversation_new_message', primary_actor: message)
expect(notification.push_message_title).to eq "[New message] - ##{notification.primary_actor.display_id} "
expect(notification.push_message_title).to eq "[New message] - ##{notification.conversation.display_id} \
#{message.content.truncate_words(10)}"
end
it 'returns appropriate title suited for the notification type conversation_mention' do