Skip to content

Commit 4df8efa

Browse files
authored
Unify I18n.locale test (#37)
1 parent 63f8b02 commit 4df8efa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/after_commit_everywhere_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
end
121121
expect(handler).to have_received(:call).with(:de)
122122
ensure
123-
I18n.enforce_available_locales = true
123+
I18n.enforce_available_locales = old_enforce_available_locales
124124
end
125125
end
126126

@@ -307,6 +307,7 @@
307307
end
308308

309309
it "preserves the locale" do
310+
old_enforce_available_locales = I18n.enforce_available_locales
310311
I18n.enforce_available_locales = false
311312

312313
ActiveRecord::Base.transaction do
@@ -315,8 +316,8 @@
315316
expect(handler).not_to have_received(:call)
316317
end
317318
expect(handler).to have_received(:call).with(:de)
318-
319-
I18n.enforce_available_locales = true
319+
ensure
320+
I18n.enforce_available_locales = old_enforce_available_locales
320321
end
321322
end
322323

0 commit comments

Comments
 (0)