From 8dd9ea0a636fb5dc8da560330dface9e62377e22 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 23 Oct 2024 12:20:24 -0400 Subject: [PATCH] Add helper for language --- spec/system/settings/preferences/other_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/system/settings/preferences/other_spec.rb b/spec/system/settings/preferences/other_spec.rb index 3438fe5ff8..7cc15f87a4 100644 --- a/spec/system/settings/preferences/other_spec.rb +++ b/spec/system/settings/preferences/other_spec.rb @@ -13,8 +13,8 @@ RSpec.describe 'Settings preferences other page' do expect(page) .to have_private_cache_control - check LanguagesHelper::SUPPORTED_LOCALES[:es].last - check LanguagesHelper::SUPPORTED_LOCALES[:fr].last + check language_field(:es) + check language_field(:fr) check mark_sensitive_field expect { save_changes } @@ -31,4 +31,8 @@ RSpec.describe 'Settings preferences other page' do def mark_sensitive_field I18n.t('simple_form.labels.defaults.setting_default_sensitive') end + + def language_field(key) + LanguagesHelper::SUPPORTED_LOCALES[key].last + end end