aboutsummaryrefslogtreecommitdiffstats
path: root/test/disk_controller_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-06 11:33:29 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-06 11:33:29 +0200
commitc624df326a4ef36919a5195a3c5509fab97dcba3 (patch)
treea8e07aabde7548d5bd4a322a9898ad123cfa40f7 /test/disk_controller_test.rb
parent5869045f2e71f0abdf3add19629d23a46b9fff0d (diff)
downloadrails-c624df326a4ef36919a5195a3c5509fab97dcba3.tar.gz
rails-c624df326a4ef36919a5195a3c5509fab97dcba3.tar.bz2
rails-c624df326a4ef36919a5195a3c5509fab97dcba3.zip
ActiveVault -> ActiveStorage
Yaroslav agreed to hand over the gem name ❤️
Diffstat (limited to 'test/disk_controller_test.rb')
-rw-r--r--test/disk_controller_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/disk_controller_test.rb b/test/disk_controller_test.rb
index eaf0b497ac..3d7f4ba6bd 100644
--- a/test/disk_controller_test.rb
+++ b/test/disk_controller_test.rb
@@ -4,30 +4,30 @@ require "database/setup"
require "action_controller"
require "action_controller/test_case"
-require "active_vault/disk_controller"
-require "active_vault/verified_key_with_expiration"
+require "active_storage/disk_controller"
+require "active_storage/verified_key_with_expiration"
-class ActiveVault::DiskControllerTest < ActionController::TestCase
+class ActiveStorage::DiskControllerTest < ActionController::TestCase
Routes = ActionDispatch::Routing::RouteSet.new.tap do |routes|
routes.draw do
- get "/rails/blobs/:encoded_key" => "active_vault/disk#show", as: :rails_disk_blob
+ get "/rails/blobs/:encoded_key" => "active_storage/disk#show", as: :rails_disk_blob
end
end
setup do
@blob = create_blob
@routes = Routes
- @controller = ActiveVault::DiskController.new
+ @controller = ActiveStorage::DiskController.new
end
test "showing blob inline" do
- get :show, params: { encoded_key: ActiveVault::VerifiedKeyWithExpiration.encode(@blob.key, expires_in: 5.minutes) }
+ get :show, params: { 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: ActiveVault::VerifiedKeyWithExpiration.encode(@blob.key, expires_in: 5.minutes), disposition: :attachment }
+ get :show, params: { 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