demarches-normaliennes/spec/features/i18n_spec.rb
Paul Chavard 3b6528decf feat(i18n): enable localization by query param
Providing a query param ("locale") will enable localization. A language picker will be shown once
localization is activated. Locale is stored in a cookie "locale".
2021-08-24 12:42:40 +02:00

19 lines
614 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

feature 'Accessing the website in different languages:' do
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
expect(page).to have_text('Connectez-vous')
click_on 'Translate'
click_on 'EN English'
# 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