forked from edavis10/redmine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use User#generate_password in MailHandler.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11457 e93f8b46-1217-0410-a6f0-8f06a7374b81
- Loading branch information
Showing
3 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,14 +726,6 @@ def test_new_user_from_attributes_should_return_valid_user | |
end | ||
end | ||
|
||
def test_new_user_from_attributes_should_respect_minimum_password_length | ||
with_settings :password_min_length => 15 do | ||
user = MailHandler.new_user_from_attributes('[email protected]') | ||
assert user.valid? | ||
assert user.password.length >= 15 | ||
end | ||
end | ||
|
||
def test_new_user_from_attributes_should_use_default_login_if_invalid | ||
user = MailHandler.new_user_from_attributes('[email protected]') | ||
assert user.valid? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,20 @@ def test_login_length_validation | |
assert user.save | ||
end | ||
|
||
def test_generate_password_should_respect_minimum_password_length | ||
with_settings :password_min_length => 15 do | ||
user = User.generate!(:generate_password => true) | ||
assert user.password.length >= 15 | ||
end | ||
end | ||
|
||
def test_generate_password_should_not_generate_password_with_less_than_10_characters | ||
with_settings :password_min_length => 4 do | ||
user = User.generate!(:generate_password => true) | ||
assert user.password.length >= 10 | ||
end | ||
end | ||
|
||
def test_generate_password_on_create_should_set_password | ||
user = User.new(:firstname => "new", :lastname => "user", :mail => "[email protected]") | ||
user.login = "newuser" | ||
|