Convert the languages fixtures to a factory
[rails.git] / test / models / language_test.rb
index cb4c8c6318d195a0ee3a347128ab666a80a7ba2a..9b2ef72c19125914afe87d0ea8f618df70a4ec5b 100644 (file)
@@ -2,20 +2,13 @@
 require "test_helper"
 
 class LanguageTest < ActiveSupport::TestCase
-  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
+    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 3, Language.count
+    assert_equal 0, Language.count
     assert_raise ActiveRecord::RecordNotFound do
       Language.find("zh")
     end