chore: Change the notification text for mention notification type (#2534)
This commit is contained in:
@@ -50,11 +50,32 @@ RSpec.describe Notification do
|
||||
end
|
||||
|
||||
it 'returns appropriate title suited for the notification type conversation_mention' do
|
||||
message = create(:message, sender: create(:user))
|
||||
message = create(:message, sender: create(:user), content: 'Hey [@John](mention://user/1/john), can you check this ticket?')
|
||||
notification = create(:notification, notification_type: 'conversation_mention', primary_actor: message, secondary_actor: message.sender)
|
||||
|
||||
expect(notification.push_message_title).to eq "You have been mentioned in conversation [ID - #{message.conversation.display_id}] \
|
||||
by #{message.sender.name}"
|
||||
expect(notification.push_message_title).to eq "[##{message.conversation.display_id}] Hey @John, can you check this ticket?"
|
||||
end
|
||||
|
||||
it 'returns appropriate title suited for the notification type conversation_mention having multiple mentions' do
|
||||
message = create(
|
||||
:message, sender:
|
||||
create(:user),
|
||||
content: 'Hey [@John](mention://user/1/john), [@Alisha Peter](mention://user/2/alisha) can you check this ticket?'
|
||||
)
|
||||
notification = create(:notification, notification_type: 'conversation_mention', primary_actor: message, secondary_actor: message.sender)
|
||||
|
||||
expect(notification.push_message_title).to eq "[##{message.conversation.display_id}] Hey @John, @Alisha Peter can you check this ticket?"
|
||||
end
|
||||
|
||||
it 'returns appropriate title suited for the notification type conversation_mention if username contains white space' do
|
||||
message = create(
|
||||
:message, sender:
|
||||
create(:user),
|
||||
content: 'Hey [@John Peter](mention://user/1/john%20K) please check this?'
|
||||
)
|
||||
notification = create(:notification, notification_type: 'conversation_mention', primary_actor: message, secondary_actor: message.sender)
|
||||
|
||||
expect(notification.push_message_title).to eq "[##{message.conversation.display_id}] Hey @John Peter please check this?"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user