aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/models/blob_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/models/blob_test.rb')
-rw-r--r--activestorage/test/models/blob_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/test/models/blob_test.rb b/activestorage/test/models/blob_test.rb
index c2e7aae13a..88c106a08b 100644
--- a/activestorage/test/models/blob_test.rb
+++ b/activestorage/test/models/blob_test.rb
@@ -174,10 +174,10 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase
assert_not ActiveStorage::Blob.service.exist?(variant.key)
end
- test "purge fails when attachments exist" do
+ test "purge does nothing when attachments exist" do
create_blob.tap do |blob|
User.create! name: "DHH", avatar: blob
- assert_raises(ActiveRecord::InvalidForeignKey) { blob.purge }
+ assert_no_difference(-> { ActiveStorage::Blob.count }) { blob.purge }
assert ActiveStorage::Blob.service.exist?(blob.key)
end
end