about summary refs log tree commit diff
path: root/spec/workers/scheduler
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/scheduler')
-rw-r--r--spec/workers/scheduler/feed_cleanup_scheduler_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb b/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb
index 4c709a2c9..b8487b03f 100644
--- a/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb
+++ b/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb
@@ -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)