|
237 | 237 | "timestamp": 12345678901234,
|
238 | 238 | "things": {
|
239 | 239 | "deviceId": "deviceid3",
|
| 240 | + "type": "scenarioResult", |
| 241 | + "result": { |
| 242 | + "scenarioId": "DUMMY_SCENARIO_ID", |
| 243 | + "revision": 0, |
| 244 | + "resultCode": "success", |
| 245 | + "startTime": 1552375571097, |
| 246 | + "endTime": 1552375571098, |
| 247 | + "bleNotificationPayload": "AAAAAA==", |
| 248 | + "actionResults": [ |
| 249 | + { |
| 250 | + "data": "mIcIAA==", |
| 251 | + "type": "binary" |
| 252 | + }, |
| 253 | + { |
| 254 | + "type": "void" |
| 255 | + }, |
| 256 | + { |
| 257 | + "type": "void" |
| 258 | + } |
| 259 | + ] |
| 260 | + } |
| 261 | + } |
| 262 | + }, |
| 263 | + { |
| 264 | + "type": "things", |
| 265 | + "replyToken": "nHuyWi...", |
| 266 | + "source": { |
| 267 | + "type": "user", |
| 268 | + "groupId": "U991eeaf62d..." |
| 269 | + }, |
| 270 | + "timestamp": 12345678901234, |
| 271 | + "things": { |
| 272 | + "deviceId": "deviceid4", |
240 | 273 | "type": "unsupport"
|
241 | 274 | }
|
242 | 275 | }
|
@@ -362,8 +395,13 @@ def generate_client
|
362 | 395 | expect(events[16].device_id).to eq('deviceid2')
|
363 | 396 |
|
364 | 397 | expect(events[17]).to be_a(Line::Bot::Event::Things)
|
365 |
| - expect(events[17].type).to eq(Line::Bot::Event::ThingsType::Unsupport) |
| 398 | + expect(events[17].type).to eq(Line::Bot::Event::ThingsType::ScenarioResult) |
366 | 399 | expect(events[17].device_id).to eq('deviceid3')
|
| 400 | + expect(events[17]["things"]["result"]["resultCode"]).to eq('success') |
| 401 | + |
| 402 | + expect(events[18]).to be_a(Line::Bot::Event::Things) |
| 403 | + expect(events[18].type).to eq(Line::Bot::Event::ThingsType::Unsupport) |
| 404 | + expect(events[18].device_id).to eq('deviceid4') |
367 | 405 | end
|
368 | 406 |
|
369 | 407 | it 'parses unknown event' do
|
|
0 commit comments