From 0fe9a36e89bde11c976f47a11eb7f17f5097943b Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 8 Jun 2021 03:44:46 +0200 Subject: [PATCH] DEV: Fix another flaky spec The error was: ``` 1) ExtraLocalesController.client_overrides_exist? returns true if there are client-side translation overrides Failure/Error: expect(ExtraLocalesController.client_overrides_exist?).to eq(false) expected: false got: true (compared using ==) Diff: @@ -1 +1 @@ -false +true # ./spec/requests/extra_locales_controller_spec.rb:162:in `block (3 levels) in
' # ./spec/rails_helper.rb:279:in `block (2 levels) in ' # .gem/ruby/2.7.3/gems/webmock-3.13.0/lib/webmock/rspec.rb:37:in `block (2 levels) in ' ``` Minimal repro: ``` bin/rspec './spec/models/trust_level_and_staff_setting_spec.rb[1:1:1]' './spec/requests/extra_locales_controller_spec.rb[1:3:2]' --tag ~type:multisite --seed 33616 ``` --- spec/models/trust_level_and_staff_setting_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/models/trust_level_and_staff_setting_spec.rb b/spec/models/trust_level_and_staff_setting_spec.rb index f538346d678..29ecff81798 100644 --- a/spec/models/trust_level_and_staff_setting_spec.rb +++ b/spec/models/trust_level_and_staff_setting_spec.rb @@ -4,6 +4,10 @@ require 'rails_helper' describe TrustLevelAndStaffSetting do describe ".values" do + after do + I18n.reload! + end + it "returns translated names" do TranslationOverride.upsert!(I18n.locale, "js.trust_levels.names.newuser", "New Member") TranslationOverride.upsert!(I18n.locale, "trust_levels.admin", "Hero")