aboutsummaryrefslogtreecommitdiffstats
path: root/test/service
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2017-07-06 15:31:31 -0400
committerGeorge Claghorn <george@basecamp.com>2017-07-06 15:31:31 -0400
commita2e864fa13c7d3d56a95a2f46d525597f989f938 (patch)
treeaee9df0c4c8786afdf1865b55a84fe2d0d7b56c3 /test/service
parent2afe0a7d90403cca862644edeb8a2e393ccbddc6 (diff)
downloadrails-a2e864fa13c7d3d56a95a2f46d525597f989f938.tar.gz
rails-a2e864fa13c7d3d56a95a2f46d525597f989f938.tar.bz2
rails-a2e864fa13c7d3d56a95a2f46d525597f989f938.zip
Fix test
* S3 fails fast if the Content-MD5 header on an upload request is an invalid checksum. Send a valid but incorrect checksum. * Rescue the service-specific exception and raise the generic one.
Diffstat (limited to 'test/service')
-rw-r--r--test/service/shared_service_tests.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/service/shared_service_tests.rb b/test/service/shared_service_tests.rb
index b4c888e77c..dfa0d61656 100644
--- a/test/service/shared_service_tests.rb
+++ b/test/service/shared_service_tests.rb
@@ -3,7 +3,7 @@ require "active_support/core_ext/securerandom"
require "yaml"
SERVICE_CONFIGURATIONS = begin
- YAML.load_file(File.expand_path("../configurations.yml", __FILE__)).deep_symbolize_keys
+ YAML.load_file(File.expand_path("../configurations.yml", __FILE__)).deep_symbolize_keys
rescue Errno::ENOENT
puts "Missing service configuration file in test/services/configurations.yml"
end
@@ -44,7 +44,7 @@ module ActiveStorage::Service::SharedServiceTests
data = "Something else entirely!"
assert_raises(ActiveStorage::IntegrityError) do
- @service.upload(key, StringIO.new(data), checksum: "BAD_CHECKSUM")
+ @service.upload(key, StringIO.new(data), checksum: Digest::MD5.base64digest("bad data"))
end
ensure
@service.delete key