diff options
Diffstat (limited to 'test/models')
-rw-r--r-- | test/models/blob_test.rb | 3 | ||||
-rw-r--r-- | test/models/verified_key_with_expiration_test.rb | 20 |
2 files changed, 1 insertions, 22 deletions
diff --git a/test/models/blob_test.rb b/test/models/blob_test.rb index ded11e5dbe..45c8b7168f 100644 --- a/test/models/blob_test.rb +++ b/test/models/blob_test.rb @@ -1,6 +1,5 @@ require "test_helper" require "database/setup" -require "active_storage/verified_key_with_expiration" class ActiveStorage::BlobTest < ActiveSupport::TestCase test "create after upload sets byte size and checksum" do @@ -36,6 +35,6 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase private def expected_url_for(blob, disposition: :inline) - "/rails/active_storage/disk/#{ActiveStorage::VerifiedKeyWithExpiration.encode(blob.key, expires_in: 5.minutes)}/#{blob.filename}?disposition=#{disposition}" + "/rails/active_storage/disk/#{ActiveStorage.verifier.generate(blob.key, expires_in: 5.minutes)}/#{blob.filename}?disposition=#{disposition}" end end diff --git a/test/models/verified_key_with_expiration_test.rb b/test/models/verified_key_with_expiration_test.rb deleted file mode 100644 index dd69e7cb10..0000000000 --- a/test/models/verified_key_with_expiration_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "test_helper" -require "active_support/core_ext/securerandom" -require "active_storage/verified_key_with_expiration" - -class ActiveStorage::VerifiedKeyWithExpirationTest < ActiveSupport::TestCase - FIXTURE_KEY = SecureRandom.base58(24) - - test "without expiration" do - encoded_key = ActiveStorage::VerifiedKeyWithExpiration.encode(FIXTURE_KEY) - assert_equal FIXTURE_KEY, ActiveStorage::VerifiedKeyWithExpiration.decode(encoded_key) - end - - test "with expiration" do - encoded_key = ActiveStorage::VerifiedKeyWithExpiration.encode(FIXTURE_KEY, expires_in: 1.minute) - assert_equal FIXTURE_KEY, ActiveStorage::VerifiedKeyWithExpiration.decode(encoded_key) - - travel 2.minutes - assert_nil ActiveStorage::VerifiedKeyWithExpiration.decode(encoded_key) - end -end |