spec/datadog/notifications/plugins/active_job_spec.rb in datadog-notifications-0.6.7 vs spec/datadog/notifications/plugins/active_job_spec.rb in datadog-notifications-0.7.0
- old
+ new
@@ -1,11 +1,20 @@
require 'spec_helper'
describe Datadog::Notifications::Plugins::ActiveJob do
it 'sanitizes tags' do
- NoopJob.perform_now
- expect(buffered).to eq [
- 'activejob.perform:1|c|#custom:tag,env:test,host:test.host,job:noop,queue:test_queue',
- 'activejob.perform.time:333|ms|#custom:tag,env:test,host:test.host,job:noop,queue:test_queue',
+ klass = Class.new(ActiveJob::Base) do
+ def self.name
+ 'Mock::NoopJob'
+ end
+
+ self.queue_name = 'test:queue'
+ def perform; end
+ end
+
+ klass.perform_now
+ expect(messages).to eq [
+ 'activejob.perform:1|c|#custom:tag,env:test,host:test.host,job:mock/noop,queue:test_queue',
+ 'activejob.perform.time:787.0|ms|#custom:tag,env:test,host:test.host,job:mock/noop,queue:test_queue',
]
end
end