fix: Attach instagram images with file type story_mentions (#4100)

This commit is contained in:
Tejaswini Chile
2022-03-10 20:27:30 +05:30
committed by GitHub
parent b3545f42f1
commit 647efa12e7
11 changed files with 219 additions and 18 deletions

View File

@@ -55,4 +55,72 @@ FactoryBot.define do
end
initialize_with { attributes }
end
factory :instagram_message_attachment_event, class: Hash do
entry do
[
{
'id': 'instagram-message-id-1234',
'time': '2021-09-08T06:34:04+0000',
'messaging': [
{
'sender': {
'id': 'Sender-id-1'
},
'recipient': {
'id': 'chatwoot-app-user-id-1'
},
'timestamp': '2021-09-08T06:34:04+0000',
'message': {
'mid': 'message-id-1',
'attachments': [
{
'type': 'share',
'payload': {
'url': 'https://imagekit.io/blog/content/images/2020/05/media_library.jpeg'
}
}
]
}
}
]
}
]
end
initialize_with { attributes }
end
factory :instagram_story_mention_event, class: Hash do
entry do
[
{
'id': 'instagram-message-id-1234',
'time': '2021-09-08T06:34:04+0000',
'messaging': [
{
'sender': {
'id': 'Sender-id-1'
},
'recipient': {
'id': 'chatwoot-app-user-id-1'
},
'timestamp': '2021-09-08T06:34:04+0000',
'message': {
'mid': 'message-id-1',
'attachments': [
{
'type': 'story_mention',
'payload': {
'url': 'https://imagekit.io/blog/content/images/2020/05/media_library.jpeg'
}
}
]
}
}
]
}
]
end
initialize_with { attributes }
end
end