spec/bobot/event/common_spec.rb in bobot-3.7.2 vs spec/bobot/event/common_spec.rb in bobot-3.7.3

- old
+ new

@@ -108,9 +108,31 @@ ) subject.reply_with_text(text: 'Hello, human') end end + describe '.reply_with_youtube_video' do + it 'replies to the sender' do + expect(subject.page).to receive(:deliver).with( + payload_template: { + message: { + attachment: { + type: 'template', + payload: { + template_type: "open_graph", + elements: [ + { url: "https://www.youtube.com/watch?v=kJQP7kiw5Fk" } + ], + }, + }, + }, + }, + to: payload['recipient']['id'], + ) + subject.reply_with_youtube_video(url: 'https://www.youtube.com/watch?v=kJQP7kiw5Fk') + end + end + describe '.reply_with_image' do it 'replies to the sender' do expect(subject.page).to receive(:deliver).with( payload_template: { message: {