Move the jobs logging handling in ApplicationJob

This commit is contained in:
gregoirenovel 2017-10-03 16:31:17 +02:00
parent 51f57d983e
commit 0006d42874
5 changed files with 25 additions and 4 deletions

View file

@ -0,0 +1,16 @@
require 'rails_helper'
include ActiveJob::TestHelper
RSpec.describe ApplicationJob, type: :job do
describe 'perform' do
it do
expect(Rails.logger).to receive(:info).with(/.+started at.+/)
expect(Rails.logger).to receive(:info).with(/.+ended at.+/)
perform_enqueued_jobs { ChildJob.perform_later }
end
end
class ChildJob < ApplicationJob
def perform; end
end
end