Try to make more robust i18n test

This commit is contained in:
Alexander Meindl 2019-05-04 12:15:36 +02:00
parent b101933208
commit 030689e903
2 changed files with 7 additions and 17 deletions

View File

@ -93,6 +93,7 @@ ja:
label_overview_right: "Overview page, right"
label_overview_top: "Overview page, top"
label_pdf_wiki_settings: PDF Wiki settings
label_planning: Planning
label_project_list: "プロジェクト一覧"
label_project_overview_content: "Project guide"
label_query_delete: Delete query

View File

@ -26,24 +26,13 @@ class I18nTest < Additionals::TestCase
assert_equal 8, lang_files_count
valid_languages.each do |lang|
assert set_language_if_valid(lang)
case lang.to_s
when 'en'
assert_equal 'External urls', l(:label_external_urls)
when 'de', 'es', 'fr', 'it', 'ja', 'zh-TW', 'zh'
assert_not l(:label_external_urls) == 'External urls', lang
end
end
# check if parse error exists
::I18n.locale = 'de'
assert_equal 'Externe URLs', l(:label_external_urls)
::I18n.locale = 'en'
assert_equal 'External urls', l(:label_external_urls)
::I18n.locale = 'es'
assert_equal 'URLs externos', l(:label_external_urls)
::I18n.locale = 'fr'
assert_equal 'Les urnes externes', l(:label_external_urls)
::I18n.locale = 'it'
assert_equal 'Esterno urls', l(:label_external_urls)
::I18n.locale = 'ja'
assert_equal '外部URL', l(:label_external_urls)
::I18n.locale = 'zh-TW'
assert_equal '外部連結', l(:label_external_urls)
::I18n.locale = 'zh'
assert_equal '外部 URLs', l(:label_external_urls)
set_language_if_valid('en')
end