Skip to content

Commit

Permalink
WIP: write failing test
Browse files Browse the repository at this point in the history
test does not fail :(
  • Loading branch information
vasconsaurus committed Dec 17, 2024
1 parent cb54d3a commit 4cf5664
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 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,51 @@ def teardown
end
TiplineRequest.any_instance.unstub(:save!)
end

test "should not create relationship between media and tipline resource" do
author = BotUser.smooch_user
same_id = random_number

t2 = create_team
pm = create_project_media team: t2
pm.update_column(:id, same_id)
puts pm.id

t = create_team
tipline_resource = create_tipline_resource team: t
tipline_resource.update_column(:id, same_id)
puts tipline_resource.id

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: 'video',
source: { type: "whatsapp" },
# text: 'Something long enough to be considered a media',
text: 'Something short',
# caption: 'Something long enough to be considered a media',
caption: 'Something short',
mediaUrl: @video_url,
'_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 4cf5664

Please sign in to comment.