Skip to content

Commit fe6fd80

Browse files
committed
chore(sidekiq): move rails spec to spec/isolated
1 parent 768dc9e commit fe6fd80

2 files changed

Lines changed: 48 additions & 50 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

sentry-sidekiq/spec/sentry/rails_spec.rb

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)