@@ -370,6 +370,16 class UserTest < ActiveSupport::TestCase | |||||
370 | assert_equal "admin", user.login |
|
370 | assert_equal "admin", user.login | |
371 | end |
|
371 | end | |
372 |
|
372 | |||
|
373 | def test_validate_password_length | |||
|
374 | with_settings :password_min_length => '100' do | |||
|
375 | user = User.new(:firstname => "new100", :lastname => "user100", :mail => "newuser100@somenet.foo") | |||
|
376 | user.login = "newuser100" | |||
|
377 | user.password, user.password_confirmation = "password100", "password100" | |||
|
378 | assert !user.save | |||
|
379 | assert_equal 1, user.errors.count | |||
|
380 | end | |||
|
381 | end | |||
|
382 | ||||
373 | def test_name_format |
|
383 | def test_name_format | |
374 | assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname) |
|
384 | assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname) | |
375 | Setting.user_format = :firstname_lastname |
|
385 | Setting.user_format = :firstname_lastname |
General Comments 0
You need to be logged in to leave comments.
Login now