9fd38cae5e
System specs have been available since Rails 5.1, and are better integrated with the Rails framework. - Rename `spec/features` to `spec/system` - Rename `feature do` to `describe do` - Configure Capybara for system specs Steps mostly taken from https://medium.com/table-xi/a-quick-guide-to-rails-system-tests-in-rspec-b6e9e8a8b5f6
19 lines
606 B
Ruby
19 lines
606 B
Ruby
describe '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 'Langues'
|
|
click_on '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
|