From 4df8efaea036a909779e1df2792296a4a804370c Mon Sep 17 00:00:00 2001 From: Bilka Date: Fri, 7 Feb 2025 12:02:25 +0100 Subject: [PATCH] Unify I18n.locale test (#37) --- spec/after_commit_everywhere_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/after_commit_everywhere_spec.rb b/spec/after_commit_everywhere_spec.rb index b8716c0..104ae62 100644 --- a/spec/after_commit_everywhere_spec.rb +++ b/spec/after_commit_everywhere_spec.rb @@ -120,7 +120,7 @@ end expect(handler).to have_received(:call).with(:de) ensure - I18n.enforce_available_locales = true + I18n.enforce_available_locales = old_enforce_available_locales end end @@ -307,6 +307,7 @@ end it "preserves the locale" do + old_enforce_available_locales = I18n.enforce_available_locales I18n.enforce_available_locales = false ActiveRecord::Base.transaction do @@ -315,8 +316,8 @@ expect(handler).not_to have_received(:call) end expect(handler).to have_received(:call).with(:de) - - I18n.enforce_available_locales = true + ensure + I18n.enforce_available_locales = old_enforce_available_locales end end