]> git.openstreetmap.org Git - rails.git/blob - test/models/language_test.rb
Fix rubocop warnings
[rails.git] / test / models / language_test.rb
1 # coding: utf-8
2
3 require "test_helper"
4
5 class LanguageTest < ActiveSupport::TestCase
6   def test_name
7     create(:language, :code => "sl", :english_name => "Slovenian", :native_name => "slovenščina")
8     assert_equal "Slovenian (slovenščina)", Language.find("sl").name
9   end
10
11   def test_load
12     assert_equal 0, Language.count
13     assert_raise ActiveRecord::RecordNotFound do
14       Language.find("zh")
15     end
16
17     Language.load("config/languages.yml")
18
19     assert_equal 197, Language.count
20     assert_not_nil Language.find("zh")
21   end
22 end