-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add additional context to ActiveJob notifications (#528)
- Loading branch information
Showing
3 changed files
with
65 additions
and
38 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,31 @@ | ||
require_relative '../rails_helper' | ||
|
||
describe 'Rails ActiveJob Adapter Test', if: RAILS_PRESENT, type: :request do | ||
include ActiveJob::TestHelper if RAILS_PRESENT | ||
load_rails_hooks(self) | ||
|
||
it 'reports exceptions' do | ||
Honeybadger.flush do | ||
perform_enqueued_jobs do | ||
expect do | ||
ErrorJob.perform_later({ some: 'data' }) | ||
end.to raise_error(StandardError) | ||
end | ||
end | ||
|
||
expect(Honeybadger::Backend::Test.notifications[:notices].size).to eq(1) | ||
expect(Honeybadger::Backend::Test.notifications[:notices][0].params[:arguments][0]).to eq({ some: 'data' }) | ||
expect(Honeybadger::Backend::Test.notifications[:notices][0].context).to \ | ||
include( | ||
component: ErrorJob, | ||
action: 'perform', | ||
enqueued_at: anything, | ||
executions: 1, | ||
job_class: ErrorJob, | ||
job_id: anything, | ||
priority: anything, | ||
queue_name: 'default', | ||
scheduled_at: anything | ||
) | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.