diff options
author | James Lopez <james@jameslopez.es> | 2016-11-25 19:10:25 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-14 16:20:55 +0300 |
commit | 3cb84e06b7a118fb46b4e1e0d4885026c9d4a4d1 (patch) | |
tree | ef622687724fd429f6f7fb02a19a022550bf8608 /spec/services/event_create_service_spec.rb | |
parent | 2951a8543ef97ceb1bcaca5f5140d822729c950b (diff) |
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.
Diffstat (limited to 'spec/services/event_create_service_spec.rb')
-rw-r--r-- | spec/services/event_create_service_spec.rb | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/spec/services/event_create_service_spec.rb b/spec/services/event_create_service_spec.rb index 54e5c0b236b..13c0aac2363 100644 --- a/spec/services/event_create_service_spec.rb +++ b/spec/services/event_create_service_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe EventCreateService, services: true do + include UserActivitiesHelpers + let(:service) { EventCreateService.new } describe 'Issues' do @@ -111,6 +113,19 @@ describe EventCreateService, services: true do end end + describe '#push', :redis do + let(:project) { create(:empty_project) } + let(:user) { create(:user) } + + it 'creates a new event' do + expect { service.push(project, user, {}) }.to change { Event.count } + end + + it 'updates user last activity' do + expect { service.push(project, user, {}) }.to change { user_score } + end + end + describe 'Project' do let(:user) { create :user } let(:project) { create(:empty_project) } @@ -129,17 +144,4 @@ describe EventCreateService, services: true do it { expect { subject }.to change { Event.count }.from(0).to(1) } end end - - describe '#push' do - let(:project) { create(:empty_project) } - let(:user) { create(:user) } - - it 'creates a new event' do - expect { service.push(project, user, {}) }.to change { Event.count } - end - - it 'updates user last activity' do - expect { service.push(project, user, {}) }.to change { user.last_activity_at } - end - end end |