2017-07-06 10:22:44 +00:00
|
|
|
require "service/shared_service_tests"
|
|
|
|
|
|
|
|
if SERVICE_CONFIGURATIONS[:s3]
|
|
|
|
class ActiveStorage::Service::S3ServiceTest < ActiveSupport::TestCase
|
2017-07-08 23:55:50 +00:00
|
|
|
SERVICE = ActiveStorage::Service.configure(:s3, SERVICE_CONFIGURATIONS)
|
2017-07-06 10:22:44 +00:00
|
|
|
|
|
|
|
include ActiveStorage::Service::SharedServiceTests
|
2017-07-09 15:04:37 +00:00
|
|
|
|
|
|
|
test "signed URL generation" do
|
|
|
|
assert_match /rails-activestorage\.s3\.amazonaws\.com.*response-content-disposition=inline.*avatar\.png/,
|
|
|
|
@service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png")
|
|
|
|
end
|
2017-07-06 10:22:44 +00:00
|
|
|
end
|
|
|
|
else
|
|
|
|
puts "Skipping S3 Service tests because no S3 configuration was supplied"
|
|
|
|
end
|