about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-19 10:21:52 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-19 16:21:52 +0200
commitdb4119f9711e6c2ac640325640f6e61b1e177ed3 (patch)
treecf7a19fe42370e81b99de7e7ac8ac01f260c8243 /spec
parent4a3db716921b2e290011b1bc33d0f19e2e8f2d55 (diff)
Specs for precompute feed service (#3142)
* Add spec for precompute feed service

* Refactor PrecomputeFeedService

* spec wip
Diffstat (limited to 'spec')
-rw-r--r--spec/services/precompute_feed_service_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/precompute_feed_service_spec.rb b/spec/services/precompute_feed_service_spec.rb
index 392cb0e4d..9f56b0256 100644
--- a/spec/services/precompute_feed_service_spec.rb
+++ b/spec/services/precompute_feed_service_spec.rb
@@ -1,5 +1,22 @@
+# frozen_string_literal: true
+
 require 'rails_helper'
 
 RSpec.describe PrecomputeFeedService do
   subject { PrecomputeFeedService.new }
+
+  describe 'call' do
+    let(:account) { Fabricate(:account) }
+    it 'fills a user timeline with statuses' do
+      account = Fabricate(:account)
+      followed_account = Fabricate(:account)
+      Fabricate(:follow, account: account, target_account: followed_account)
+      status = Fabricate(:status, account: followed_account)
+
+      expected_redis_args = FeedManager.instance.key(:home, account.id), status.id, status.id
+      expect_any_instance_of(Redis).to receive(:zadd).with(*expected_redis_args)
+
+      subject.call(account)
+    end
+  end
 end