]> git.openstreetmap.org Git - rails.git/blob - test/jobs/trace_destroyer_job_test.rb
Merge remote-tracking branch 'upstream/pull/2923' into master
[rails.git] / test / jobs / trace_destroyer_job_test.rb
1 require "test_helper"
2 require "minitest/mock"
3
4 class TraceDestroyerJobTest < ActiveJob::TestCase
5   def test_destroy_called
6     trace = Minitest::Mock.new
7
8     # Tiny little bit of mocking to make activejob happy
9     trace.expect :is_a?, false, [TraceDestroyerJob]
10
11     # Check that trace.destroy is called
12     trace.expect :destroy, true
13
14     TraceDestroyerJob.perform_now(trace)
15
16     assert_mock trace
17   end
18 end