Skip to content

Commit

Permalink
WIP: write failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
vasconsaurus committed Dec 13, 2024
1 parent cb54d3a commit c733a36
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/models/bot/smooch_7_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c733a36

Please sign in to comment.