X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e59f1b610817ad8442bc639d479cebe0a851c05a..2e1f6428e7d03a109db57b0d0614ecd2c0e5d5c1:/test/jobs/trace_destroyer_job_test.rb?ds=sidebyside 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