X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f04211b1722e27037b305b58479157b5a492f30a..06d03c8acccfadfe7e2bf441c9fbd0044e7a2fcf:/test/models/language_test.rb?ds=inline diff --git a/test/models/language_test.rb b/test/models/language_test.rb index cb4c8c631..f777d8e19 100644 --- a/test/models/language_test.rb +++ b/test/models/language_test.rb @@ -1,21 +1,18 @@ -# coding: utf-8 require "test_helper" class LanguageTest < ActiveSupport::TestCase - fixtures :languages - - def test_language_count - assert_equal 3, Language.count + def test_name + create(:language, :code => "sl", :english_name => "Slovenian", :native_name => "slovenščina") + assert_equal "Slovenian (slovenščina)", Language.find("sl").name end - def test_name - assert_equal "English (English)", languages(:en).name - assert_equal "German (Deutsch)", languages(:de).name - assert_equal "Slovenian (slovenščina)", languages(:sl).name + def test_same_native_name + create(:language, :code => "af", :english_name => "Afrikaans", :native_name => "Afrikaans") + assert_equal "Afrikaans", Language.find("af").name end def test_load - assert_equal 3, Language.count + assert_equal 0, Language.count assert_raise ActiveRecord::RecordNotFound do Language.find("zh") end