-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jon de Andres
committed
Apr 13, 2016
1 parent
a0a6d36
commit bed9150
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Rollbar | ||
module Delay | ||
class DelayedJob | ||
class << self | ||
def call(payload) | ||
new.delay.call(payload) | ||
end | ||
end | ||
|
||
def call(payload) | ||
Rollbar.process_from_async_handler(payload) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'spec_helper' | ||
|
||
require 'delayed_job' | ||
require 'delayed/worker' | ||
require 'rollbar/delay/delayed_job' | ||
|
||
describe Rollbar::Delay::DelayedJob do | ||
before do | ||
h Delayed::Worker.delay_jobs = false | ||
end | ||
|
||
describe '.call' do | ||
let(:payload) { {} } | ||
it 'calls Rollbar' do | ||
expect(Rollbar).to receive(:process_from_async_handler).with(payload) | ||
|
||
Rollbar::Delay::DelayedJob.call(payload) | ||
end | ||
end | ||
end |