summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-05 11:50:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-05 11:50:53 +0000
commita00f04886fac78e489bb030d20414ebdf10841e3 (patch)
tree91d304c1be59bd251afb54143c288eebef2ed1e4 /test/unit/user_test.rb
parent1d4ef8964def4ecbe7a11485f72d7fbe61c55724 (diff)
downloadredmine-a00f04886fac78e489bb030d20414ebdf10841e3.tar.gz
redmine-a00f04886fac78e489bb030d20414ebdf10841e3.zip
Increase username length limit from 30 to 60 (#2719).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8778 e93f8b46-1217-0410-a6f0-8f06a7374b81
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")