aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/service
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2018-05-22 17:34:19 -0400
committerGitHub <noreply@github.com>2018-05-22 17:34:19 -0400
commitbdd8b6843c4af7042b5b019762d450c604418e01 (patch)
tree86992c0c4a159adf759ff6b8adc59df8bfbb7610 /activestorage/test/service
parent96c02b58f32b1a9bba6c958363b3b96cad9a2957 (diff)
parenta21d11ce80abfbd9d58ce685ff1a5139d732d532 (diff)
downloadrails-bdd8b6843c4af7042b5b019762d450c604418e01.tar.gz
rails-bdd8b6843c4af7042b5b019762d450c604418e01.tar.bz2
rails-bdd8b6843c4af7042b5b019762d450c604418e01.zip
Merge pull request #32144 from kazu9su/master
Add ActiveStorage::Service::DiskService#url_for_direct_upload test
Diffstat (limited to 'activestorage/test/service')
-rw-r--r--activestorage/test/service/disk_service_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activestorage/test/service/disk_service_test.rb b/activestorage/test/service/disk_service_test.rb
index d7142de458..a4f2f4765f 100644
--- a/activestorage/test/service/disk_service_test.rb
+++ b/activestorage/test/service/disk_service_test.rb
@@ -11,4 +11,8 @@ class ActiveStorage::Service::DiskServiceTest < ActiveSupport::TestCase
assert_match(/^https:\/\/example.com\/rails\/active_storage\/disk\/.*\/avatar\.png\?content_type=image%2Fpng&disposition=inline/,
@service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png"))
end
+
+ test "headers_for_direct_upload generation" do
+ assert_equal({ "Content-Type" => "application/json" }, @service.headers_for_direct_upload(FIXTURE_KEY, content_type: "application/json"))
+ end
end