diff options
Diffstat (limited to 'test/functional/my_controller_test.rb')
-rw-r--r-- | test/functional/my_controller_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 6577aee6a..53c73341a 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -185,6 +185,18 @@ class MyControllerTest < ActionController::TestCase assert User.try_to_login('jsmith', 'secret123') end + def test_change_password_kills_other_sessions + @request.session[:ctime] = (Time.now - 30.minutes).utc.to_i + + jsmith = User.find(2) + jsmith.passwd_changed_on = Time.now + jsmith.save! + + get 'account' + assert_response 302 + assert flash[:error].match(/Your session has expired/) + end + def test_change_password_should_redirect_if_user_cannot_change_its_password User.find(2).update_attribute(:auth_source_id, 1) |