2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-10-26 11:44:53 +02:00
|
|
|
describe 'Accessing the website in different languages:' do
|
2021-05-25 16:34:50 +02:00
|
|
|
context 'when the i18n feature-flag is enabled' do
|
|
|
|
before { ENV['LOCALIZATION_ENABLED'] = 'true' }
|
|
|
|
after { ENV['LOCALIZATION_ENABLED'] = 'false' }
|
|
|
|
|
|
|
|
scenario 'I can change the language of the page' do
|
|
|
|
visit new_user_session_path
|
2022-12-20 17:51:36 +01:00
|
|
|
expect(page).to have_text("Connexion à #{APPLICATION_NAME}")
|
2021-05-25 16:34:50 +02:00
|
|
|
|
2022-08-19 15:58:34 +02:00
|
|
|
find('.fr-translate__btn').click
|
|
|
|
find('.fr-nav__link[hreflang="en"]').click
|
2021-05-25 16:34:50 +02:00
|
|
|
|
|
|
|
# The page is now in English
|
|
|
|
expect(page).to have_text('Sign in')
|
|
|
|
# The page URL stayed the same
|
|
|
|
expect(page).to have_current_path(new_user_session_path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|