X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f2d13c075660efb9582d7fb600bd6798d7a382ca..c3ad6aa2923c03aeeea0b57033b0a9238d262aa2:/test/models/language_test.rb?ds=sidebyside diff --git a/test/models/language_test.rb b/test/models/language_test.rb index a9d6f5d6a..cb4c8c631 100644 --- a/test/models/language_test.rb +++ b/test/models/language_test.rb @@ -1,7 +1,28 @@ -require 'test_helper' +# coding: utf-8 +require "test_helper" class LanguageTest < ActiveSupport::TestCase - test "language count" do + fixtures :languages + + def test_language_count + assert_equal 3, Language.count + 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 + end + + def test_load assert_equal 3, 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