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