From 4181f859623c41a679ae5b9e8453c750778eb8de Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 15 Mar 2009 10:49:18 +0000 Subject: [PATCH] Fixes that user's last_login_on was not set when using registration with automatic activation. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2594 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/account_controller.rb | 1 + test/integration/account_test.rb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 9842b9ead..79d3041e1 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -248,6 +248,7 @@ class AccountController < ApplicationController def register_automatically(user, &block) # Automatic activation user.status = User::STATUS_ACTIVE + user.last_login_on = Time.now if user.save self.logged_user = user flash[:notice] = l(:notice_account_activated) diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index a82743333..e8ae884a6 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -110,7 +110,10 @@ class AccountTest < ActionController::IntegrationTest assert_response :success assert_template 'my/account' - assert User.find_by_login('newuser').active? + user = User.find_by_login('newuser') + assert_not_nil user + assert user.active? + assert_not_nil user.last_login_on end def test_register_with_manual_activation -- 2.39.5