From 3cb84e06b7a118fb46b4e1e0d4885026c9d4a4d1 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 25 Nov 2016 17:10:25 +0100 Subject: Remove user activities table and use redis instead of PG for recording activities Refactored specs and added a post deployment migration to remove the activity users table. --- spec/controllers/sessions_controller_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'spec/controllers/sessions_controller_spec.rb') diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index 3459f30ef42..d817099394a 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -16,7 +16,9 @@ describe SessionsController do end end - context 'when using valid password' do + context 'when using valid password', :redis do + include UserActivitiesHelpers + let(:user) { create(:user) } it 'authenticates user correctly' do @@ -41,7 +43,7 @@ describe SessionsController do 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.to change { user_score }.from(0) end end end -- cgit v1.2.3