Reset I18n.local for each spec

This avoids a locale setting leaking from one spec to another. It also
means that we don't have to reset the locale in individual specs.

Also:

- `cookies` is reset automatically and we don't need to do that.
- Removed some unused code (German number format and helper methods).
This commit is contained in:
Maikel Linke
2024-04-11 10:05:49 +10:00
parent b2172ef8d8
commit c2c7910357
5 changed files with 8 additions and 40 deletions

View File

@@ -59,16 +59,6 @@ describe Spree::Variant do
end
context "price parsing" do
around(:each) do |spec|
default_locale = I18n.default_locale
I18n.with_locale(default_locale) do
I18n.backend.store_translations(:de,
{ number: { currency: { format: { delimiter: '.',
separator: ',' } } } })
spec.run
end
end
context "price=" do
context "with decimal point" do
it "captures the proper amount for a formatted price" do