X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c82c760e9dc690540e2e5cf8de577d0a1ac3154d..e2e79ba549a7c2f668ccb9b0fab7d6245cb826c5:/test/models/language_test.rb?ds=inline diff --git a/test/models/language_test.rb b/test/models/language_test.rb index 39e3f017b..5ba558907 100644 --- a/test/models/language_test.rb +++ b/test/models/language_test.rb @@ -1,9 +1,20 @@ require "test_helper" class LanguageTest < ActiveSupport::TestCase - fixtures :languages + 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") - test "language count" do - assert_equal 3, Language.count + assert_equal 197, Language.count + assert_not_nil Language.find("zh") end end