Move the jobs logging handling in ApplicationJob
This commit is contained in:
parent
51f57d983e
commit
0006d42874
5 changed files with 25 additions and 4 deletions
16
spec/jobs/application_job_spec.rb
Normal file
16
spec/jobs/application_job_spec.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue