diff options
author | James Lopez <james@jameslopez.es> | 2016-10-05 17:41:32 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-14 16:20:55 +0300 |
commit | 2951a8543ef97ceb1bcaca5f5140d822729c950b (patch) | |
tree | ff02540e813cd93e8df8a438c9b22cdacc96982e /spec/controllers | |
parent | b61199ce0ccdfcd11a338778ce300cd15e5f2a43 (diff) |
Add user activity service and spec. Also added relevant - NOT offline - migration
It uses a user activity table instead of a column in users.
Tested with mySQL and postgreSQL
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/sessions_controller_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index 9c16a7bc08b..3459f30ef42 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -37,6 +37,12 @@ describe SessionsController do subject.sign_out user end end + + it 'updates the user activity' do + expect do + post(:create, user: { login: user.username, password: user.password }) + end.to change { user.reload.last_activity_at }.from(nil) + end end end |