aboutsummaryrefslogtreecommitdiffstats
path: root/test/service
diff options
context:
space:
mode:
Diffstat (limited to 'test/service')
-rw-r--r--test/service/gcs_service_test.rb11
-rw-r--r--test/service/s3_service_test.rb9
2 files changed, 11 insertions, 9 deletions
diff --git a/test/service/gcs_service_test.rb b/test/service/gcs_service_test.rb
index 57fe4d4562..134a06e3a4 100644
--- a/test/service/gcs_service_test.rb
+++ b/test/service/gcs_service_test.rb
@@ -9,14 +9,15 @@ if SERVICE_CONFIGURATIONS[:gcs]
test "direct upload" do
begin
- key = SecureRandom.base58(24)
- data = "Something else entirely!"
- direct_upload_url = @service.url_for_direct_upload(key, expires_in: 5.minutes, content_type: "text/plain", content_length: data.size)
+ key = SecureRandom.base58(24)
+ data = "Something else entirely!"
+ checksum = Digest::MD5.base64digest(data)
+ url = @service.url_for_direct_upload(key, expires_in: 5.minutes, content_type: "text/plain", content_length: data.size, checksum: checksum)
HTTParty.put(
- direct_upload_url,
+ url,
body: data,
- headers: { "Content-Type" => "text/plain" },
+ headers: { "Content-Type" => "text/plain", "Content-MD5" => checksum },
debug_output: STDOUT
)
diff --git a/test/service/s3_service_test.rb b/test/service/s3_service_test.rb
index a6040ec1d5..019652e28f 100644
--- a/test/service/s3_service_test.rb
+++ b/test/service/s3_service_test.rb
@@ -9,14 +9,15 @@ if SERVICE_CONFIGURATIONS[:s3]
test "direct upload" do
begin
- key = SecureRandom.base58(24)
- data = "Something else entirely!"
- url = @service.url_for_direct_upload(key, expires_in: 5.minutes, content_type: "text/plain", content_length: data.size)
+ key = SecureRandom.base58(24)
+ data = "Something else entirely!"
+ checksum = Digest::MD5.base64digest(data)
+ url = @service.url_for_direct_upload(key, expires_in: 5.minutes, content_type: "text/plain", content_length: data.size, checksum: checksum)
HTTParty.put(
url,
body: data,
- headers: { "Content-Type" => "text/plain" },
+ headers: { "Content-Type" => "text/plain", "Content-MD5" => checksum },
debug_output: STDOUT
)