提交 c8ad7dc1 编写于 作者: J James T. Perreault 提交者: George Claghorn

Replace hard-coded S3 bucket name with configured bucket

上级 bb7b8348
......@@ -27,7 +27,7 @@ class ActiveStorage::S3DirectUploadsControllerTest < ActionController::TestCase
details = JSON.parse(@response.body)
assert_match /rails-activestorage\.s3.amazonaws\.com/, details["url"]
assert_match /#{SERVICE_CONFIGURATIONS[:s3][:bucket]}\.s3.(\S+)?amazonaws\.com/, details["url"]
assert_equal "hello.txt", GlobalID::Locator.locate_signed(details["sgid"]).filename.to_s
end
end
......
......@@ -27,7 +27,7 @@ class ActiveStorage::Service::S3ServiceTest < ActiveSupport::TestCase
end
test "signed URL generation" do
assert_match /.+s3.+amazonaws.com.*response-content-disposition=inline.*avatar\.png/,
assert_match /#{SERVICE_CONFIGURATIONS[:s3][:bucket]}\.s3.(\S+)?amazonaws.com.*response-content-disposition=inline.*avatar\.png/,
@service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png")
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册