diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d0a55d7e21..09c0def612 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -221,11 +221,6 @@ Metrics/PerceivedComplexity: - 'app/models/spree/ability.rb' - 'app/models/spree/order/checkout.rb' -# Offense count: 1 -Naming/AccessorMethodName: - Exclude: - - 'spec/support/request/web_helper.rb' - # Offense count: 1 # Configuration parameters: ForbiddenDelimiters. # ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 21f5159c07..29861cf56f 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -33,7 +33,7 @@ module WebHelper page.execute_script("I18n.locale = '#{locale}'") end - def get_i18n_locale + def pick_i18n_locale page.evaluate_script("I18n.locale;") end diff --git a/spec/system/admin/multilingual_spec.rb b/spec/system/admin/multilingual_spec.rb index 0f9f0900bd..a4135bdfdd 100644 --- a/spec/system/admin/multilingual_spec.rb +++ b/spec/system/admin/multilingual_spec.rb @@ -19,13 +19,13 @@ RSpec.describe 'Multilingual' do end it 'can switch language by params' do - expect(get_i18n_locale).to eq 'en' + expect(pick_i18n_locale).to eq 'en' expect(get_i18n_translation('spree_admin_overview_enterprises_header')).to eq 'My Enterprises' expect(page).to have_content 'My Enterprises' expect(admin_user.locale).to be_nil visit spree.admin_dashboard_path(locale: 'es') - expect(get_i18n_locale).to eq 'es' + expect(pick_i18n_locale).to eq 'es' expect(get_i18n_translation('spree_admin_overview_enterprises_header')) .to eq 'Mis Organizaciones' expect(page).to have_content 'Mis Organizaciones' @@ -35,7 +35,7 @@ RSpec.describe 'Multilingual' do it 'fallbacks to default_locale' do visit spree.admin_dashboard_path(locale: 'it') - expect(get_i18n_locale).to eq 'en' + expect(pick_i18n_locale).to eq 'en' expect(get_i18n_translation('spree_admin_overview_enterprises_header')).to eq 'My Enterprises' expect(page).to have_content 'My Enterprises' expect(admin_user.locale).to be_nil diff --git a/spec/system/consumer/multilingual_spec.rb b/spec/system/consumer/multilingual_spec.rb index a89ec41af0..2d5df6446b 100644 --- a/spec/system/consumer/multilingual_spec.rb +++ b/spec/system/consumer/multilingual_spec.rb @@ -25,19 +25,19 @@ RSpec.describe 'Multilingual' do context 'can switch language by params' do it 'in root path' do visit root_path - expect(get_i18n_locale).to eq 'en' + expect(pick_i18n_locale).to eq 'en' expect(get_i18n_translation('label_shops')).to eq 'Shops' expect(cookies_name).not_to include('locale') expect(page).to have_content 'SHOPS' visit root_path(locale: 'es') - expect(get_i18n_locale).to eq 'es' + expect(pick_i18n_locale).to eq 'es' expect(get_i18n_translation('label_shops')).to eq 'Tiendas' expect_menu_and_cookie_in_es # it is not in the list of available of available_locales visit root_path(locale: 'it') - expect(get_i18n_locale).to eq 'es' + expect(pick_i18n_locale).to eq 'es' expect(get_i18n_translation('label_shops')).to eq 'Tiendas' expect_menu_and_cookie_in_es end