diff --git a/test/models/bot/smooch_7_test.rb b/test/models/bot/smooch_7_test.rb index 10217674c..72173b2c3 100644 --- a/test/models/bot/smooch_7_test.rb +++ b/test/models/bot/smooch_7_test.rb @@ -632,4 +632,45 @@ def teardown end TiplineRequest.any_instance.unstub(:save!) end + + test "should not create relationship between media and tipline resource" do + t = create_team + tipline_resource = create_tipline_resource team: t + author = BotUser.smooch_user + + Sidekiq::Testing.inline! do + # message = { + # type: 'video', + # text: 'Something long enough to be considered a media', + # caption: 'I have a caption!', + # # role: 'appUser', + # # received: 1573082583.219, + # # name: random_string, + # # authorId: random_string, + # # '_id': random_string, + # source: { + # # originalMessageId: random_string, + # # originalMessageTimestamp: 1573082582, + # type: 'whatsapp', + # # integrationId: random_string + # }, + # language: 'en', + # } + message = { + type: 'file', + source: { type: "whatsapp" }, + text: random_string, + caption: random_string, + mediaUrl: @video_url, + mediaType: 'image/jpeg', + role: 'appUser', + received: 1573082583.219, + name: random_string, + authorId: random_string, + '_id': random_string, + language: 'en', + } + Bot::Smooch.save_message(message.to_json, @app_id, author, 'resource_requests', tipline_resource.id, 'TiplineResource') + end + end end