@@ -157,7 +157,7 class ApplicationController < ActionController::Base | |||
|
157 | 157 | # Logs out current user |
|
158 | 158 | def logout_user |
|
159 | 159 | if User.current.logged? |
|
160 |
cookies.delete |
|
|
160 | cookies.delete(autologin_cookie_name) | |
|
161 | 161 | Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) |
|
162 | 162 | self.logged_user = nil |
|
163 | 163 | end |
@@ -87,6 +87,11 class AccountTest < ActionController::IntegrationTest | |||
|
87 | 87 | cookies['custom_autologin'] = token |
|
88 | 88 | get '/my/page' |
|
89 | 89 | assert_response :success |
|
90 | ||
|
91 | assert_difference 'Token.count', -1 do | |
|
92 | post '/logout' | |
|
93 | end | |
|
94 | assert cookies['custom_autologin'].blank? | |
|
90 | 95 | end |
|
91 | 96 | end |
|
92 | 97 |
General Comments 0
You need to be logged in to leave comments.
Login now