The code powering m.abunchtell.com https://m.abunchtell.com
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

32 рядки
801 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe 'Localization' do
  4. it 'uses a specific region when provided' do
  5. headers = { 'Accept-Language' => 'zh-HK' }
  6. get "/about", headers: headers
  7. expect(response.body).to include(
  8. I18n.t('about.about_mastodon', locale: 'zh-HK')
  9. )
  10. end
  11. it 'falls back to a locale when region missing' do
  12. headers = { 'Accept-Language' => 'es-FAKE' }
  13. get "/about", headers: headers
  14. expect(response.body).to include(
  15. I18n.t('about.about_mastodon', locale: 'es')
  16. )
  17. end
  18. it 'falls back to english when locale is missing' do
  19. headers = { 'Accept-Language' => '12-FAKE' }
  20. get "/about", headers: headers
  21. expect(response.body).to include(
  22. I18n.t('about.about_mastodon', locale: 'en')
  23. )
  24. end
  25. end