|
7 | 7 |
|
8 | 8 | expect(conversation_client) |
9 | 9 | .to receive(:request) |
10 | | - .with(:post, 'send', from: 'MBTest', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' }) |
| 10 | + .with(:post, 'send', { from: 'MBTest', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } }) |
11 | 11 | .and_return('{}') |
12 | 12 |
|
13 | 13 | client.send_conversation_message('MBTest', 31_612_345_678, type: 'text', content: { text: 'Hi there!' }) |
|
19 | 19 |
|
20 | 20 | expect(conversation_client) |
21 | 21 | .to receive(:request) |
22 | | - .with(:post, 'conversations/start', channel_id: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' }) |
| 22 | + .with(:post, 'conversations/start', { channel_id: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } }) |
23 | 23 | .and_return('{}') |
24 | 24 |
|
25 | 25 | client.start_conversation(31_612_345_678, 'c0dae31e440145e094c4708b7d000000', type: 'text', content: { text: 'Hi there!' }) |
|
109 | 109 |
|
110 | 110 | expect(conversation_client) |
111 | 111 | .to receive(:request) |
112 | | - .with(:patch, 'conversations/conversation-id', status: MessageBird::Conversation::CONVERSATION_STATUS_ARCHIVED) |
| 112 | + .with(:patch, 'conversations/conversation-id', { status: MessageBird::Conversation::CONVERSATION_STATUS_ARCHIVED }) |
113 | 113 | .and_return('{"id":"conversation-id", "contactId": "contact-id"}') |
114 | 114 | conversation = client.conversation_update('conversation-id', MessageBird::Conversation::CONVERSATION_STATUS_ARCHIVED) |
115 | 115 |
|
|
123 | 123 |
|
124 | 124 | expect(conversation_client) |
125 | 125 | .to receive(:request) |
126 | | - .with(:post, 'conversations/conversation-id/messages', type: 'text', content: { text: 'Hi there' }) |
| 126 | + .with(:post, 'conversations/conversation-id/messages', { type: 'text', content: { text: 'Hi there' } }) |
127 | 127 | .and_return({ id: 'message-id', channel_id: 'channel-id', conversationId: 'conversation-id' }.to_json) |
128 | 128 |
|
129 | 129 | msg = client.conversation_reply('conversation-id', type: 'text', content: { text: 'Hi there' }) |
|
168 | 168 |
|
169 | 169 | expect(conversation_client) |
170 | 170 | .to receive(:request) |
171 | | - .with(:post, 'webhooks', channel_id: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url') |
| 171 | + .with(:post, 'webhooks', { channel_id: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url' }) |
172 | 172 | .and_return('{"id":"00000000000000000000000000000000", "events": ["message.created", "message.updated"]}') |
173 | 173 |
|
174 | 174 | webhook = client.conversation_webhook_create('channel-id', 'url', [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED]) |
|
212 | 212 |
|
213 | 213 | expect(conversation_client) |
214 | 214 | .to receive(:request) |
215 | | - .with(:patch, 'webhooks/webhook-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED], url: 'url') |
| 215 | + .with(:patch, 'webhooks/webhook-id', { events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED], url: 'url' }) |
216 | 216 | .and_return('{"id":"00000000000000000000000000000000", "events": ["message.created"]}') |
217 | 217 |
|
218 | 218 | webhook = client.conversation_webhook_update('webhook-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED], url: 'url') |
|
0 commit comments