summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-21 06:13:16 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-21 06:13:16 +0000
commit80581538a16406855f1c0fcff637b5f9cde2d2d6 (patch)
tree3d2a2ca95ec70818185a4b4a4fde0036adace85d /test/unit/user_test.rb
parent97c7e84f4929bae6851f30d5436ffc67ffbe0b6b (diff)
downloadredmine-80581538a16406855f1c0fcff637b5f9cde2d2d6.tar.gz
redmine-80581538a16406855f1c0fcff637b5f9cde2d2d6.zip
add test of validate password length at unit user test
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7430 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 1d982241e..9a3ca6bc3 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -370,6 +370,16 @@ class UserTest < ActiveSupport::TestCase
assert_equal "admin", user.login
end
+ def test_validate_password_length
+ with_settings :password_min_length => '100' do
+ user = User.new(:firstname => "new100", :lastname => "user100", :mail => "newuser100@somenet.foo")
+ user.login = "newuser100"
+ user.password, user.password_confirmation = "password100", "password100"
+ assert !user.save
+ assert_equal 1, user.errors.count
+ end
+ end
+
def test_name_format
assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname)
Setting.user_format = :firstname_lastname