]> git.openstreetmap.org Git - rails.git/blob - test/models/language_test.rb
Suppress XML parsing errors.
[rails.git] / test / models / language_test.rb
1 # coding: utf-8
2 require "test_helper"
3
4 class LanguageTest < ActiveSupport::TestCase
5   fixtures :languages
6
7   def test_language_count
8     assert_equal 3, Language.count
9   end
10
11   def test_name
12     assert_equal "English (English)", languages(:en).name
13     assert_equal "German (Deutsch)", languages(:de).name
14     assert_equal "Slovenian (slovenščina)", languages(:sl).name
15   end
16
17   def test_load
18     assert_equal 3, Language.count
19     assert_raise ActiveRecord::RecordNotFound do
20       Language.find("zh")
21     end
22
23     Language.load("config/languages.yml")
24
25     assert_equal 197, Language.count
26     assert_not_nil Language.find("zh")
27   end
28 end