2020-06-12 17:42:47 +00:00
|
|
|
module SlackStubs
|
|
|
|
def slack_url_verification_stub
|
|
|
|
{
|
|
|
|
"token": 'Jhj5dZrVaK7ZwHHjRyZWjbDl',
|
|
|
|
"challenge": '3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P',
|
|
|
|
"type": 'url_verification'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def slack_message_stub
|
|
|
|
{
|
|
|
|
"token": '[FILTERED]',
|
|
|
|
"team_id": 'TLST3048H',
|
|
|
|
"api_app_id": 'A012S5UETV4',
|
2020-06-22 07:49:26 +00:00
|
|
|
"event": message_event,
|
2020-06-12 17:42:47 +00:00
|
|
|
"type": 'event_callback',
|
|
|
|
"event_id": 'Ev013QUX3WV6',
|
|
|
|
"event_time": 1_588_623_033,
|
|
|
|
"authed_users": '[FILTERED]',
|
|
|
|
"webhook": {}
|
|
|
|
}
|
|
|
|
end
|
2020-06-22 07:49:26 +00:00
|
|
|
|
2020-11-09 16:31:57 +00:00
|
|
|
def slack_message_stub_without_thread_ts
|
|
|
|
{
|
|
|
|
"token": '[FILTERED]',
|
|
|
|
"team_id": '',
|
|
|
|
"api_app_id": '',
|
|
|
|
"event": {
|
|
|
|
"type": 'message',
|
|
|
|
"client_msg_id": 'ffc6e64e-6f0c-4a3d-b594-faa6b44e48ab',
|
|
|
|
"text": 'this is test',
|
|
|
|
"user": 'ULYPAKE5S',
|
|
|
|
"ts": '1588623033.006000',
|
|
|
|
"team": 'TLST3048H'
|
|
|
|
},
|
|
|
|
"type": 'event_callback',
|
|
|
|
"event_id": '',
|
|
|
|
"event_time": 1_588_623_033,
|
|
|
|
"authed_users": '[FILTERED]',
|
|
|
|
"webhook": {}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2020-06-22 07:49:26 +00:00
|
|
|
def message_event
|
2020-11-09 16:31:57 +00:00
|
|
|
{
|
|
|
|
"client_msg_id": 'ffc6e64e-6f0c-4a3d-b594-faa6b44e48ab',
|
2020-06-22 07:49:26 +00:00
|
|
|
"type": 'message',
|
2021-07-09 12:15:02 +00:00
|
|
|
"text": 'this is test <https://chatwoot.com> Hey <@U019KT237LP|Sojan> Test again',
|
2020-06-22 07:49:26 +00:00
|
|
|
"user": 'ULYPAKE5S',
|
|
|
|
"ts": '1588623033.006000',
|
|
|
|
"team": 'TLST3048H',
|
|
|
|
"blocks": message_blocks,
|
|
|
|
"thread_ts": '1588623023.005900',
|
|
|
|
"channel": 'G01354F6A6Q',
|
|
|
|
"event_ts": '1588623033.006000',
|
2020-11-09 16:31:57 +00:00
|
|
|
"channel_type": 'group'
|
|
|
|
}
|
2020-06-22 07:49:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def message_blocks
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"type": 'rich_text',
|
|
|
|
"block_id": 'jaIv3',
|
|
|
|
"elements": [
|
|
|
|
{
|
|
|
|
"type": 'rich_text_section',
|
|
|
|
"elements": [
|
|
|
|
{
|
|
|
|
"type": 'text',
|
|
|
|
"text": 'this is test'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
end
|
2020-06-12 17:42:47 +00:00
|
|
|
end
|