X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dc2a2c8ebd1a11e4a64555fda22c6859a51defff..424b6ef1cf760c4a3e27ac1e6f612ae42a9cd493:/test/models/language_test.rb diff --git a/test/models/language_test.rb b/test/models/language_test.rb index ac79b3a9d..5ba558907 100644 --- a/test/models/language_test.rb +++ b/test/models/language_test.rb @@ -1,7 +1,20 @@ require "test_helper" class LanguageTest < ActiveSupport::TestCase - test "language count" do - 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_load + assert_equal 0, Language.count + assert_raise ActiveRecord::RecordNotFound do + Language.find("zh") + end + + Language.load("config/languages.yml") + + assert_equal 197, Language.count + assert_not_nil Language.find("zh") end end