DEV: Clear extra-locales cache between tests (#31488)

This commit is contained in:
David Taylor
2025-02-24 22:10:43 +00:00
committed by GitHub
parent db3db9fe41
commit 109fc428d8
2 changed files with 10 additions and 2 deletions
+7 -2
View File
@@ -74,9 +74,14 @@ class ExtraLocalesController < ApplicationController
[js, digest_for_content(js)]
end
def clear_cache!
def clear_cache!(all_sites: false)
site = RailsMultisite::ConnectionManagement.current_db
js_digests[:site_specific].delete(site)
if all_sites
js_digests[:site_specific].clear
js_digests[:shared].clear
else
js_digests[:site_specific].delete(site)
end
end
def digest_for_content(js)
@@ -2,6 +2,9 @@
RSpec.describe ExtraLocalesController do
around { |example| allow_missing_translations(&example) }
after { ExtraLocalesController.clear_cache!(all_sites: true) }
let(:fake_digest) { "a" * 40 }
describe "#show" do