0
0
Fork 0

Overwrite old statuses with reblogs in PrecomputeFeedService (#3984)

This commit is contained in:
Akihiko Odaki (@fn_aki@pawoo.net) 2017-06-28 21:50:23 +09:00 committed by Eugen Rochko
parent fb421a1f46
commit 7d8e3721ae
5 changed files with 19 additions and 10 deletions

View file

@ -7,10 +7,13 @@ describe Scheduler::FeedCleanupScheduler do
let!(:inactive_user) { Fabricate(:user, current_sign_in_at: 22.days.ago) }
it 'clears feeds of inactives' do
expect_any_instance_of(Redis).to receive(:del).with(feed_key_for(inactive_user))
expect_any_instance_of(Redis).not_to receive(:del).with(feed_key_for(active_user))
Redis.current.zadd(feed_key_for(inactive_user), 1, 1)
Redis.current.zadd(feed_key_for(active_user), 1, 1)
subject.perform
expect(Redis.current.zcard(feed_key_for(inactive_user))).to eq 0
expect(Redis.current.zcard(feed_key_for(active_user))).to eq 1
end
def feed_key_for(user)