diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-05-10 10:26:55 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-05-10 10:26:55 +0000 |
commit | 51f7060aa8464f51f78403f87b3556a7ffaa1995 (patch) | |
tree | cb7a82d8d788a2e71bb57de7e536bd7048e956f8 /test/integration | |
parent | 92833d0b10e7c46477e1485a4bf616649aee544e (diff) | |
download | redmine-51f7060aa8464f51f78403f87b3556a7ffaa1995.tar.gz redmine-51f7060aa8464f51f78403f87b3556a7ffaa1995.zip |
Add the ability to expire passwords after a configurable number of days (#19458).
Patch by Holger Just and Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@14264 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/account_test.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index 7f2f0e4ff..9ff6cc0a3 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -150,6 +150,40 @@ class AccountTest < Redmine::IntegrationTest assert_equal false, User.find_by_login('jsmith').must_change_passwd? end + def test_user_with_expired_password_should_be_forced_to_change_its_password + User.find_by_login('jsmith').update_attribute :passwd_changed_on, 14.days.ago + + with_settings :password_max_age => 7 do + post '/login', :username => 'jsmith', :password => 'jsmith' + assert_redirected_to '/my/page' + follow_redirect! + assert_redirected_to '/my/password' + + get '/issues' + assert_redirected_to '/my/password' + end + end + + def test_user_with_expired_password_should_be_able_to_change_its_password + User.find_by_login('jsmith').update_attribute :passwd_changed_on, 14.days.ago + + with_settings :password_max_age => 7 do + post '/login', :username => 'jsmith', :password => 'jsmith' + assert_redirected_to '/my/page' + follow_redirect! + assert_redirected_to '/my/password' + follow_redirect! + assert_response :success + post '/my/password', :password => 'jsmith', :new_password => 'newpassword', :new_password_confirmation => 'newpassword' + assert_redirected_to '/my/account' + follow_redirect! + assert_response :success + + assert_equal false, User.find_by_login('jsmith').must_change_passwd? + end + + end + def test_register_with_automatic_activation Setting.self_registration = '3' |