Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rails/activestorage
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jul 23, 2017
2 parents 15efa67 + 4efbeae commit df69899
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/controllers/direct_uploads_controller_test.rb
Expand Up @@ -22,10 +22,10 @@ class ActiveStorage::S3DirectUploadsControllerTest < ActionController::TestCase
post :create, params: { blob: {
filename: "hello.txt", byte_size: 6, checksum: Digest::MD5.base64digest("Hello"), content_type: "text/plain" } }

details = JSON.parse(@response.body)

assert_match /#{SERVICE_CONFIGURATIONS[:s3][:bucket]}\.s3.(\S+)?amazonaws\.com/, details["upload_to_url"]
assert_equal "hello.txt", ActiveStorage::Blob.find_signed(details["signed_blob_id"]).filename.to_s
@response.parsed_body.tap do |details|
assert_match(/#{SERVICE_CONFIGURATIONS[:s3][:bucket]}\.s3.(\S+)?amazonaws\.com/, details["upload_to_url"])
assert_equal "hello.txt", ActiveStorage::Blob.find_signed(details["signed_blob_id"]).filename.to_s
end
end
end
else
Expand All @@ -52,10 +52,10 @@ class ActiveStorage::GCSDirectUploadsControllerTest < ActionController::TestCase
post :create, params: { blob: {
filename: "hello.txt", byte_size: 6, checksum: Digest::MD5.base64digest("Hello"), content_type: "text/plain" } }

details = JSON.parse(@response.body)

assert_match %r{storage\.googleapis\.com/#{@config[:bucket]}}, details["upload_to_url"]
assert_equal "hello.txt", ActiveStorage::Blob.find_signed(details["signed_blob_id"]).filename.to_s
@response.parsed_body.tap do |details|
assert_match %r{storage\.googleapis\.com/#{@config[:bucket]}}, details["upload_to_url"]
assert_equal "hello.txt", ActiveStorage::Blob.find_signed(details["signed_blob_id"]).filename.to_s
end
end
end
else
Expand Down

0 comments on commit df69899

Please sign in to comment.