mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 06:48:18 +08:00
FIX: Multisite DB was leaving old data in test mode
This commit introduces a new helper to enable transactional fixtures when testing multisite. This would show up as tests that passed the first time then failed the second time due to stale data being leftover.
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Multisite SiteSettings', type: :multisite do
|
||||
let(:conn) { RailsMultisite::ConnectionManagement }
|
||||
|
||||
def cache(name, namespace: true)
|
||||
DistributedCache.new(name, namespace: namespace)
|
||||
end
|
||||
@ -15,7 +13,7 @@ RSpec.describe 'Multisite SiteSettings', type: :multisite do
|
||||
|
||||
expect(cache1.hash).to eq('default' => true)
|
||||
|
||||
conn.with_connection('second') do
|
||||
test_multisite_connection('second') do
|
||||
message = MessageBus.track_publish(DistributedCache::Manager::CHANNEL_NAME) do
|
||||
cache1['second'] = true
|
||||
end.first
|
||||
|
Reference in New Issue
Block a user