From 918d1d83639dd684e02ed47816605027eb81818b Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Sun, 18 Oct 2020 12:00:35 +0200 Subject: [PATCH] DEV: Fix heisentest (#10946) This should fix the following sporadic spec failure: ``` 1) JsLocaleHelper performs fallbacks to English if a translation is not available Failure/Error: expect(ctx.eval('I18n.translations.uk.js').keys).to contain_exactly("all_three", "english_and_user", "only_user", "site_and_user") expected collection contained: ["all_three", "english_and_user", "only_user", "site_and_user"] actual collection contained: ["about", "action_codes", "activity", "admin", "admin_title", "adplugin", "age", "akismet", "all_time..."voting", "week", "week_desc", "weekly", "wizard_required", "year", "year_desc", "yes_value", "you"] the missing elements were: ["all_three", "english_and_user", "only_user", "site_and_user"] the extra elements were: ["about", "action_codes", "activity", "admin", "admin_title", "adplugin", "age", "akismet", "all_time..."voting", "week", "week_desc", "weekly", "wizard_required", "year", "year_desc", "yes_value", "you"] # ./spec/components/js_locale_helper_spec.rb:182:in `block (2 levels) in
' # ./bundle/ruby/2.6.0/gems/webmock-3.9.2/lib/webmock/rspec.rb:37:in `block (2 levels) in ' ``` --- spec/components/js_locale_helper_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/components/js_locale_helper_spec.rb b/spec/components/js_locale_helper_spec.rb index e1c9cb40bba..6bce0bd7973 100644 --- a/spec/components/js_locale_helper_spec.rb +++ b/spec/components/js_locale_helper_spec.rb @@ -19,9 +19,8 @@ describe JsLocaleHelper do JsLocaleHelper.extend StubLoadTranslations - after do - JsLocaleHelper.clear_cache! - end + before { JsLocaleHelper.clear_cache! } + after { JsLocaleHelper.clear_cache! } describe "#output_locale" do