Basic tests for the trace jobs

This commit is contained in:
Andy Allan 2019-01-23 14:47:49 +01:00
parent 6820d53e5f
commit 3b96bbc809
2 changed files with 76 additions and 8 deletions

View file

@ -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