diff options
Diffstat (limited to 'test/disk_controller_test.rb')
-rw-r--r-- | test/disk_controller_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/disk_controller_test.rb b/test/disk_controller_test.rb index 3d7f4ba6bd..119ee5828f 100644 --- a/test/disk_controller_test.rb +++ b/test/disk_controller_test.rb @@ -10,7 +10,7 @@ require "active_storage/verified_key_with_expiration" class ActiveStorage::DiskControllerTest < ActionController::TestCase Routes = ActionDispatch::Routing::RouteSet.new.tap do |routes| routes.draw do - get "/rails/blobs/:encoded_key" => "active_storage/disk#show", as: :rails_disk_blob + get "/rails/blobs/:encoded_key/*filename" => "active_storage/disk#show", as: :rails_disk_blob end end @@ -21,13 +21,13 @@ class ActiveStorage::DiskControllerTest < ActionController::TestCase end test "showing blob inline" do - get :show, params: { encoded_key: ActiveStorage::VerifiedKeyWithExpiration.encode(@blob.key, expires_in: 5.minutes) } + get :show, params: { filename: @blob.filename, encoded_key: ActiveStorage::VerifiedKeyWithExpiration.encode(@blob.key, expires_in: 5.minutes) } assert_equal "inline; filename=\"#{@blob.filename}\"", @response.headers["Content-Disposition"] assert_equal "text/plain", @response.headers["Content-Type"] end test "sending blob as attachment" do - get :show, params: { encoded_key: ActiveStorage::VerifiedKeyWithExpiration.encode(@blob.key, expires_in: 5.minutes), disposition: :attachment } + get :show, params: { filename: @blob.filename, encoded_key: ActiveStorage::VerifiedKeyWithExpiration.encode(@blob.key, expires_in: 5.minutes), disposition: :attachment } assert_equal "attachment; filename=\"#{@blob.filename}\"", @response.headers["Content-Disposition"] assert_equal "text/plain", @response.headers["Content-Type"] end |