2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-09-11 10:15:06 +08:00
|
|
|
RSpec.describe "Running Sidekiq Jobs in Multisite", type: :multisite do
|
2017-10-11 17:17:03 +08:00
|
|
|
it 'should revert back to the default connection' do
|
2018-09-11 10:15:06 +08:00
|
|
|
expect do
|
|
|
|
Jobs::DestroyOldDeletionStubs.new.perform({})
|
|
|
|
end.to_not change { RailsMultisite::ConnectionManagement.current_db }
|
2017-10-11 17:17:03 +08:00
|
|
|
end
|
2021-02-12 21:52:59 +08:00
|
|
|
|
|
|
|
it 'CheckNewFeatures should only hit the payload once' do
|
|
|
|
# otherwise it will get rate-limited by meta
|
|
|
|
DiscourseUpdates.expects(:new_features_payload).returns("{}").once
|
|
|
|
Jobs::CheckNewFeatures.new.perform({})
|
|
|
|
end
|
2017-10-11 17:17:03 +08:00
|
|
|
end
|