Skip to content

Commit 949f65f

Browse files
authored
Append uuid onto messaging media upload (#34)
1 parent 8da6232 commit 949f65f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/integration/test_integration.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# A simple integration test against Bandwidth's APIs
44

55
require 'test/unit'
6+
require 'securerandom'
67
require_relative '../../lib/bandwidth.rb'
78

89
include Bandwidth
@@ -66,16 +67,16 @@ def test_create_message_invalid_phone_number
6667

6768
def test_upload_download_media
6869
#define constants for upload media and download media
69-
media_file_name = 'ruby_integration' #future update to add special symbols
70-
media_file = '12345' #todo: check a binary string
70+
media_id = "text-media-id-" + SecureRandom.uuid
71+
media = "Hello world"
7172

7273
#media upload
73-
@bandwidth_client.messaging_client.client.upload_media(BW_ACCOUNT_ID, media_file_name, media_file, :content_type => "application/octet-stream", :cache_control => "no-cache")
74+
@bandwidth_client.messaging_client.client.upload_media(BW_ACCOUNT_ID, media_id, media, :content_type => "application/octet-stream", :cache_control => "no-cache")
7475

7576
#media download
76-
downloaded_media_file = @bandwidth_client.messaging_client.client.get_media(BW_ACCOUNT_ID, media_file_name).data
77+
downloaded_media = @bandwidth_client.messaging_client.client.get_media(BW_ACCOUNT_ID, media_id).data
7778

78-
assert_equal(downloaded_media_file, media_file, "Downloaded media file not equal to upload")
79+
assert_equal(downloaded_media, media, "Downloaded media file not equal to upload")
7980
end
8081

8182
def test_create_call_and_get_call_state

0 commit comments

Comments
 (0)