discourse/spec/multisite/jobs_spec.rb

25 lines
591 B
Ruby
Raw Normal View History

require 'rails_helper'
RSpec.describe "Running Sidekiq Jobs in Multisite" do
2017-10-11 05:45:19 -04:00
let(:conn) { RailsMultisite::ConnectionManagement }
before do
conn.config_filename = "spec/fixtures/multisite/two_dbs.yml"
2018-01-18 21:18:04 -05:00
SiteSetting.defaults.refresh_site_locale!
2017-10-11 05:45:19 -04:00
end
after do
conn.clear_settings!
end
it 'should revert back to the default connection' do
expect(RailsMultisite::ConnectionManagement.current_db)
.to eq('default')
Jobs::DestroyOldDeletionStubs.new.perform({})
expect(RailsMultisite::ConnectionManagement.current_db)
.to eq('default')
end
end