summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index a9484501d..b75555383 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -58,6 +58,16 @@ class UserTest < ActiveSupport::TestCase
u.errors[:mail].to_s
end
+ def test_login_length_validation
+ user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
+ user.login = "x" * (User::LOGIN_LENGTH_LIMIT+1)
+ assert !user.valid?
+
+ user.login = "x" * (User::LOGIN_LENGTH_LIMIT)
+ assert user.valid?
+ assert user.save
+ end
+
def test_create
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")