Merged r11519 and r11520 from trunk (#13335).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11569 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -68,6 +68,33 @@ class AccountTest < ActionController::IntegrationTest
|
||||
assert_not_nil user.reload.last_login_on
|
||||
end
|
||||
|
||||
def test_autologin_should_use_autologin_cookie_name
|
||||
Token.delete_all
|
||||
Redmine::Configuration.stubs(:[]).with('autologin_cookie_name').returns('custom_autologin')
|
||||
Redmine::Configuration.stubs(:[]).with('autologin_cookie_path').returns('/')
|
||||
Redmine::Configuration.stubs(:[]).with('autologin_cookie_secure').returns(false)
|
||||
|
||||
with_settings :autologin => '7' do
|
||||
assert_difference 'Token.count' do
|
||||
post '/login', :username => 'admin', :password => 'admin', :autologin => 1
|
||||
end
|
||||
assert_response 302
|
||||
assert cookies['custom_autologin'].present?
|
||||
token = cookies['custom_autologin']
|
||||
|
||||
# Session is cleared
|
||||
reset!
|
||||
cookies['custom_autologin'] = token
|
||||
get '/my/page'
|
||||
assert_response :success
|
||||
|
||||
assert_difference 'Token.count', -1 do
|
||||
post '/logout'
|
||||
end
|
||||
assert cookies['custom_autologin'].blank?
|
||||
end
|
||||
end
|
||||
|
||||
def test_lost_password
|
||||
Token.delete_all
|
||||
|
||||
|
||||
Reference in New Issue
Block a user