mirror of
https://github.com/we-promise/sure.git
synced 2026-04-26 23:44:12 +00:00
Set last_login_at only at login instead of every single action (#1017)
This commit is contained in:
18
test/controllers/sessions_controller_test.rb
Normal file
18
test/controllers/sessions_controller_test.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
require "test_helper"
|
||||
|
||||
class SessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@user = users(:family_admin)
|
||||
end
|
||||
|
||||
test "can sign in" do
|
||||
post session_url, params: { email: @user.email, password: "password" }
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
|
||||
test "sets last_login_at on successful login" do
|
||||
assert_changes -> { @user.reload.last_login_at }, from: nil do
|
||||
post session_url, params: { email: @user.email, password: "password" }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user