File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ begin
4+ require "simplecov"
5+ SimpleCov . command_name "SidekiqRails"
6+ rescue LoadError
7+ end
8+
9+ require "sentry-rails"
10+
11+ RSpec . describe Sentry ::Sidekiq do
12+ def make_basic_app
13+ app = Class . new ( Rails ::Application ) do
14+ def self . name
15+ "RailsTestApp"
16+ end
17+ end
18+
19+ app . config . hosts = nil
20+ app . config . secret_key_base = "test"
21+ app . config . eager_load = false
22+
23+ app . initializer :configure_sentry do
24+ Sentry . init do |config |
25+ config . release = 'beta'
26+ config . dsn = "dummy://12345:67890@sentry.localdomain:3000/sentry/42"
27+ config . transport . transport_class = Sentry ::DummyTransport
28+ # for sending events synchronously
29+ config . background_worker_threads = 0
30+ yield ( config , app ) if block_given?
31+ end
32+ end
33+
34+ app . initialize!
35+ Rails . application = app
36+ app
37+ end
38+
39+ context "with default config" do
40+ before do
41+ make_basic_app
42+ end
43+
44+ it "adds sidekiq adapter to config.rails.skippable_job_adapters" do
45+ expect ( Sentry . configuration . rails . skippable_job_adapters ) . to include ( "ActiveJob::QueueAdapters::SidekiqAdapter" )
46+ end
47+ end
48+ end
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments