X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e59f1b610817ad8442bc639d479cebe0a851c05a..15d2efe2df28738d5182105555761293dcaaeaaf:/test/jobs/trace_destroyer_job_test.rb diff --git a/test/jobs/trace_destroyer_job_test.rb b/test/jobs/trace_destroyer_job_test.rb index 0c62716a0..ed86a1616 100644 --- a/test/jobs/trace_destroyer_job_test.rb +++ b/test/jobs/trace_destroyer_job_test.rb @@ -1,7 +1,18 @@ -require 'test_helper' +require "test_helper" +require "minitest/mock" class TraceDestroyerJobTest < ActiveJob::TestCase - # test "the truth" do - # assert true - # end + def test_destroy_called + trace = Minitest::Mock.new + + # Tiny little bit of mocking to make activejob happy + trace.expect :is_a?, false, [TraceDestroyerJob] + + # Check that trace.destroy is called + trace.expect :destroy, true + + TraceDestroyerJob.perform_now(trace) + + assert_mock trace + end end