|
372 | 372 |
|
373 | 373 | expect(status_code).to eq(200) |
374 | 374 | expect(body).to be_a(Line::Bot::V2::MessagingApi::PushMessageResponse) |
375 | | - # TODO: Add test after https://github.com/line/line-bot-sdk-ruby/issues/440 is resolved |
376 | | - # We should access body.sent_messages[0].id and body.sent_messages[0].quote_token, but it's not possible now. |
377 | | - expect(body.sent_messages).to eq([{ id: '461230966842064897', quote_token: 'IStG5h1Tz7b...' }]) |
| 375 | + expect(body.sent_messages).to be_a(Array) |
| 376 | + expect(body.sent_messages[0]).to be_a(Line::Bot::V2::MessagingApi::SentMessage) |
| 377 | + expect(body.sent_messages[0].id).to eq('461230966842064897') |
| 378 | + expect(body.sent_messages[0].quote_token).to eq('IStG5h1Tz7b...') |
378 | 379 | end |
379 | 380 |
|
380 | 381 | it 'response - success - using hash (not recommended way)' do |
|
452 | 453 |
|
453 | 454 | expect(status_code).to eq(200) |
454 | 455 | expect(body).to be_a(Line::Bot::V2::MessagingApi::PushMessageResponse) |
455 | | - # TODO: Add test after https://github.com/line/line-bot-sdk-ruby/issues/440 is resolved |
456 | | - # We should access body.sent_messages[0].id and body.sent_messages[0].quote_token, but it's not possible now. |
457 | | - expect(body.sent_messages).to eq([{ id: '461230966842064897', quote_token: 'IStG5h1Tz7b...' }]) |
| 456 | + expect(body.sent_messages).to be_a(Array) |
| 457 | + expect(body.sent_messages[0]).to be_a(Line::Bot::V2::MessagingApi::SentMessage) |
| 458 | + expect(body.sent_messages[0].id).to eq('461230966842064897') |
| 459 | + expect(body.sent_messages[0].quote_token).to eq('IStG5h1Tz7b...') |
458 | 460 | end |
459 | 461 |
|
460 | 462 | it 'request with x_line_retry_key: nil' do |
|
530 | 532 | ) |
531 | 533 | expect(status_code).to eq(200) |
532 | 534 | expect(body).to be_a(Line::Bot::V2::MessagingApi::PushMessageResponse) |
533 | | - # TODO: Add test after https://github.com/line/line-bot-sdk-ruby/issues/440 is resolved |
534 | | - # We should access body.sent_messages[0].id and body.sent_messages[0].quote_token, but it's not possible now. |
535 | | - expect(body.sent_messages).to eq([{ id: '461230966842064897', quote_token: 'IStG5h1Tz7b...' }]) |
| 535 | + expect(body.sent_messages).to be_a(Array) |
| 536 | + expect(body.sent_messages[0]).to be_a(Line::Bot::V2::MessagingApi::SentMessage) |
| 537 | + expect(body.sent_messages[0].id).to eq('461230966842064897') |
| 538 | + expect(body.sent_messages[0].quote_token).to eq('IStG5h1Tz7b...') |
536 | 539 | end |
537 | 540 |
|
538 | 541 | it 'request with x-line-retry-key header - conflicted' do |
|
588 | 591 | expect(status_code).to eq(409) |
589 | 592 | expect(body).to be_a(Line::Bot::V2::MessagingApi::ErrorResponse) |
590 | 593 | expect(body.message).to eq("The retry key is already accepted") |
591 | | - # TODO: Add test after https://github.com/line/line-bot-sdk-ruby/issues/440 is resolved. |
592 | | - # We should access body.sent_messages[0].id and body.sent_messages[0].quote_token, but it's not possible now. |
593 | | - expect(body.sent_messages).to eq([{ id: '461230966842064897', quote_token: 'IStG5h1Tz7b...' }]) |
| 594 | + expect(body.sent_messages).to be_a(Array) |
| 595 | + expect(body.sent_messages[0]).to be_a(Line::Bot::V2::MessagingApi::SentMessage) |
| 596 | + expect(body.sent_messages[0].id).to eq('461230966842064897') |
| 597 | + expect(body.sent_messages[0].quote_token).to eq('IStG5h1Tz7b...') |
594 | 598 | expect(headers['x-line-request-id']).to eq(request_id) |
595 | 599 | expect(headers['x-line-accepted-request-id']).to eq(accepted_request_id) |
596 | 600 | end |
|
975 | 979 | alt_text: 'Test Alt Text', |
976 | 980 | contents: Line::Bot::V2::MessagingApi::FlexBubble.new( # FlexBubble has many optional fields |
977 | 981 | direction: 'ltr', |
978 | | - body: Line::Bot::V2::MessagingApi::FlexText.new( |
979 | | - text: 'Test Text', |
980 | | - weight: 'bold', |
981 | | - size: 'xl' |
| 982 | + body: Line::Bot::V2::MessagingApi::FlexBox.new( |
| 983 | + layout: 'vertical', |
| 984 | + contents: [ |
| 985 | + Line::Bot::V2::MessagingApi::FlexText.new( |
| 986 | + text: 'Test Text', |
| 987 | + weight: 'bold' |
| 988 | + ) |
| 989 | + ] |
982 | 990 | ) |
983 | 991 | ), |
984 | 992 | quick_reply: Line::Bot::V2::MessagingApi::QuickReply.new( |
|
995 | 1003 | type: 'bubble', |
996 | 1004 | direction: 'ltr', |
997 | 1005 | body: { |
998 | | - type: 'text', |
999 | | - text: 'Test Text', |
1000 | | - size: 'xl', |
1001 | | - weight: 'bold' |
| 1006 | + type: 'box', |
| 1007 | + layout: 'vertical', |
| 1008 | + contents: [ |
| 1009 | + { |
| 1010 | + type: 'text', |
| 1011 | + text: 'Test Text', |
| 1012 | + weight: 'bold' |
| 1013 | + } |
| 1014 | + ] |
1002 | 1015 | } |
1003 | 1016 | } |
1004 | 1017 | } |
|
0 commit comments