You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
689 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe PrecomputeFeedService do
  4. subject { PrecomputeFeedService.new }
  5. describe 'call' do
  6. let(:account) { Fabricate(:account) }
  7. it 'fills a user timeline with statuses' do
  8. account = Fabricate(:account)
  9. followed_account = Fabricate(:account)
  10. Fabricate(:follow, account: account, target_account: followed_account)
  11. status = Fabricate(:status, account: followed_account)
  12. expected_redis_args = FeedManager.instance.key(:home, account.id), status.id, status.id
  13. expect_any_instance_of(Redis).to receive(:zadd).with(*expected_redis_args)
  14. subject.call(account)
  15. end
  16. end
  17. end