fixing the new display name test
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Tue, 15 Jul 2008 18:04:35 +0000 (18:04 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Tue, 15 Jul 2008 18:04:35 +0000 (18:04 +0000)
test/unit/user_test.rb

index bb17368b49b46ce464edb59223b547383d9b1f63..583b06e69492dce35a7d2a49fb4192e837ef1804 100644 (file)
@@ -56,7 +56,13 @@ class UserTest < Test::Unit::TestCase
   
   def test_display_name_length
     user = users(:normal_user)
+    user.display_name = "123"
+    assert user.valid?, " should allow nil display name"
+    user.display_name = "12"
+    assert !user.valid?, "should not allow 2 char name"
+    user.display_name = ""
+    assert !user.valid?
     user.display_name = nil
-    asser user.valid, " should allow nil display name"
+    assert !user.valid?
   end
 end