|
200 | 200 | } |
201 | 201 | ] |
202 | 202 | } |
| 203 | + }, |
| 204 | + { |
| 205 | + "type": "things", |
| 206 | + "replyToken": "nHuyWi...", |
| 207 | + "source": { |
| 208 | + "type": "user", |
| 209 | + "groupId": "U991eeaf62d..." |
| 210 | + }, |
| 211 | + "timestamp": 12345678901234, |
| 212 | + "things": { |
| 213 | + "deviceId": "deviceid1", |
| 214 | + "type": "link" |
| 215 | + } |
| 216 | + }, |
| 217 | + { |
| 218 | + "type": "things", |
| 219 | + "replyToken": "nHuyWi...", |
| 220 | + "source": { |
| 221 | + "type": "user", |
| 222 | + "groupId": "U991eeaf62d..." |
| 223 | + }, |
| 224 | + "timestamp": 12345678901234, |
| 225 | + "things": { |
| 226 | + "deviceId": "deviceid2", |
| 227 | + "type": "unlink" |
| 228 | + } |
| 229 | + }, |
| 230 | + { |
| 231 | + "type": "things", |
| 232 | + "replyToken": "nHuyWi...", |
| 233 | + "source": { |
| 234 | + "type": "user", |
| 235 | + "groupId": "U991eeaf62d..." |
| 236 | + }, |
| 237 | + "timestamp": 12345678901234, |
| 238 | + "things": { |
| 239 | + "deviceId": "deviceid3", |
| 240 | + "type": "unsupport" |
| 241 | + } |
203 | 242 | } |
204 | 243 | ] |
205 | 244 | } |
@@ -313,6 +352,18 @@ def generate_client |
313 | 352 |
|
314 | 353 | expect(events[13]).to be_a(Line::Bot::Event::MemberJoined) |
315 | 354 | expect(events[14]).to be_a(Line::Bot::Event::MemberLeft) |
| 355 | + |
| 356 | + expect(events[15]).to be_a(Line::Bot::Event::Things) |
| 357 | + expect(events[15].type).to eq(Line::Bot::Event::ThingsType::Link) |
| 358 | + expect(events[15].device_id).to eq('deviceid1') |
| 359 | + |
| 360 | + expect(events[16]).to be_a(Line::Bot::Event::Things) |
| 361 | + expect(events[16].type).to eq(Line::Bot::Event::ThingsType::Unlink) |
| 362 | + expect(events[16].device_id).to eq('deviceid2') |
| 363 | + |
| 364 | + expect(events[17]).to be_a(Line::Bot::Event::Things) |
| 365 | + expect(events[17].type).to eq(Line::Bot::Event::ThingsType::Unsupport) |
| 366 | + expect(events[17].device_id).to eq('deviceid3') |
316 | 367 | end |
317 | 368 |
|
318 | 369 | it 'parses unknown event' do |
|
0 commit comments