Overwrite old statuses with reblogs in PrecomputeFeedService (#3984)
This commit is contained in:
parent
fb421a1f46
commit
7d8e3721ae
5 changed files with 19 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue