diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-06 11:33:29 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-06 11:33:29 +0200 |
commit | c624df326a4ef36919a5195a3c5509fab97dcba3 (patch) | |
tree | a8e07aabde7548d5bd4a322a9898ad123cfa40f7 /test/attachments_test.rb | |
parent | 5869045f2e71f0abdf3add19629d23a46b9fff0d (diff) | |
download | rails-c624df326a4ef36919a5195a3c5509fab97dcba3.tar.gz rails-c624df326a4ef36919a5195a3c5509fab97dcba3.tar.bz2 rails-c624df326a4ef36919a5195a3c5509fab97dcba3.zip |
ActiveVault -> ActiveStorage
Yaroslav agreed to hand over the gem name ❤️
Diffstat (limited to 'test/attachments_test.rb')
-rw-r--r-- | test/attachments_test.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/attachments_test.rb b/test/attachments_test.rb index 1b784b50c1..6e25002bb1 100644 --- a/test/attachments_test.rb +++ b/test/attachments_test.rb @@ -1,6 +1,6 @@ require "test_helper" require "database/setup" -require "active_vault/blob" +require "active_storage/blob" require "active_job" ActiveJob::Base.queue_adapter = :test @@ -13,12 +13,12 @@ class User < ActiveRecord::Base has_many_attached :highlights end -class ActiveVault::AttachmentsTest < ActiveSupport::TestCase +class ActiveStorage::AttachmentsTest < ActiveSupport::TestCase include ActiveJob::TestHelper setup { @user = User.create!(name: "DHH") } - teardown { ActiveVault::Blob.all.each(&:purge) } + teardown { ActiveStorage::Blob.all.each(&:purge) } test "attach existing blob" do @user.avatar.attach create_blob(filename: "funky.jpg") @@ -36,7 +36,7 @@ class ActiveVault::AttachmentsTest < ActiveSupport::TestCase @user.avatar.purge assert_not @user.avatar.attached? - assert_not ActiveVault::Blob.site.exist?(avatar_key) + assert_not ActiveStorage::Blob.site.exist?(avatar_key) end test "purge attached blob later when the record is destroyed" do @@ -46,8 +46,8 @@ class ActiveVault::AttachmentsTest < ActiveSupport::TestCase perform_enqueued_jobs do @user.destroy - assert_nil ActiveVault::Blob.find_by(key: avatar_key) - assert_not ActiveVault::Blob.site.exist?(avatar_key) + assert_nil ActiveStorage::Blob.find_by(key: avatar_key) + assert_not ActiveStorage::Blob.site.exist?(avatar_key) end end @@ -74,8 +74,8 @@ class ActiveVault::AttachmentsTest < ActiveSupport::TestCase @user.highlights.purge assert_not @user.highlights.attached? - assert_not ActiveVault::Blob.site.exist?(highlight_keys.first) - assert_not ActiveVault::Blob.site.exist?(highlight_keys.second) + assert_not ActiveStorage::Blob.site.exist?(highlight_keys.first) + assert_not ActiveStorage::Blob.site.exist?(highlight_keys.second) end test "purge attached blobs later when the record is destroyed" do @@ -85,11 +85,11 @@ class ActiveVault::AttachmentsTest < ActiveSupport::TestCase perform_enqueued_jobs do @user.destroy - assert_nil ActiveVault::Blob.find_by(key: highlight_keys.first) - assert_not ActiveVault::Blob.site.exist?(highlight_keys.first) + assert_nil ActiveStorage::Blob.find_by(key: highlight_keys.first) + assert_not ActiveStorage::Blob.site.exist?(highlight_keys.first) - assert_nil ActiveVault::Blob.find_by(key: highlight_keys.second) - assert_not ActiveVault::Blob.site.exist?(highlight_keys.second) + assert_nil ActiveStorage::Blob.find_by(key: highlight_keys.second) + assert_not ActiveStorage::Blob.site.exist?(highlight_keys.second) end end end |