1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activestorage/test/jobs/purge_job_test.rb
George Claghorn 116fae6ef9 Remove superfluous test
This test no longer covers the behavior of ActiveStorage::PurgeJob. Attached blobs are ignored by ActiveStorage::Blob#purge as of 934fccd, which includes an equivalent model test.
2018-08-19 01:10:50 -04:00

27 lines
617 B
Ruby

# frozen_string_literal: true
require "test_helper"
require "database/setup"
class ActiveStorage::PurgeJobTest < ActiveJob::TestCase
setup { @blob = create_blob }
test "purges" do
assert_difference -> { ActiveStorage::Blob.count }, -1 do
ActiveStorage::PurgeJob.perform_now @blob
end
assert_not ActiveStorage::Blob.exists?(@blob.id)
assert_not ActiveStorage::Blob.service.exist?(@blob.key)
end
test "ignores missing blob" do
@blob.purge
perform_enqueued_jobs do
assert_nothing_raised do
ActiveStorage::PurgeJob.perform_later @blob
end
end
end
end