1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Replace hard-coded S3 bucket name with configured bucket

This commit is contained in:
James T. Perreault 2017-07-17 10:17:33 -04:00 committed by George Claghorn
parent bb7b8348e6
commit c8ad7dc13b
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ if SERVICE_CONFIGURATIONS[:s3]
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

View file

@ -27,7 +27,7 @@ if SERVICE_CONFIGURATIONS[:s3]
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