diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-23 16:27:33 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-23 16:35:16 -0500 |
commit | c977eef67b5c64932064bc98d2bb293315afc65a (patch) | |
tree | 2fa75ee3b4b78ce57c16d516f5d3a63f49cd2e37 /test | |
parent | 91d6c6e889d432da8ffc7e1102547cdea1d609be (diff) | |
download | rails-c977eef67b5c64932064bc98d2bb293315afc65a.tar.gz rails-c977eef67b5c64932064bc98d2bb293315afc65a.tar.bz2 rails-c977eef67b5c64932064bc98d2bb293315afc65a.zip |
Work-around until @response.parsed_body problem is solved
Diffstat (limited to 'test')
-rw-r--r-- | test/controllers/direct_uploads_controller_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/controllers/direct_uploads_controller_test.rb b/test/controllers/direct_uploads_controller_test.rb index 60b15b1fdd..8f309d0b28 100644 --- a/test/controllers/direct_uploads_controller_test.rb +++ b/test/controllers/direct_uploads_controller_test.rb @@ -22,7 +22,7 @@ if SERVICE_CONFIGURATIONS[:s3] post :create, params: { blob: { filename: "hello.txt", byte_size: 6, checksum: Digest::MD5.base64digest("Hello"), content_type: "text/plain" } } - @response.parsed_body.tap do |details| + JSON.parse(@response.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 @@ -52,7 +52,7 @@ if SERVICE_CONFIGURATIONS[:gcs] post :create, params: { blob: { filename: "hello.txt", byte_size: 6, checksum: Digest::MD5.base64digest("Hello"), content_type: "text/plain" } } - @response.parsed_body.tap do |details| + JSON.parse(@response.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 |