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

Fix regular expression on s3 test URL generation test (#44)

So tests are passing if the bucket name is rails-active storage.
But developers specify their own s3 tests configuration (in my case was
activestorage-test) then this regex fails.

Also the first part is dynamic and based on bucket name and region
This commit is contained in:
Dino Maric 2017-07-13 21:54:06 +02:00 committed by David Heinemeier Hansson
parent 50bec56254
commit 14e6386b3c

View file

@ -38,7 +38,7 @@ if SERVICE_CONFIGURATIONS[:s3]
end end
test "signed URL generation" do test "signed URL generation" do
assert_match /rails-activestorage\.s3\.amazonaws\.com.*response-content-disposition=inline.*avatar\.png/, assert_match /.+s3.+amazonaws.com.*response-content-disposition=inline.*avatar\.png/,
@service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png") @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png")
end end
end end