]> source.dussan.org Git - redmine.git/commitdiff
Fixes that user's last_login_on was not set when using registration with automatic...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Mar 2009 10:49:18 +0000 (10:49 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Mar 2009 10:49:18 +0000 (10:49 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2594 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/account_controller.rb
test/integration/account_test.rb

index 9842b9ead799b9184227a255c9c6948b4f2bc827..79d3041e1591f59ac1f4b524705221622e0dd619 100644 (file)
@@ -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)
index a82743333ffa550a3391411a9e70f826088acf19..e8ae884a665b4b744ea5e7b7428eb209b0c2b38c 100644 (file)
@@ -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