From f8f0572ee09122dd8fda51aec899f939c6ab03bf Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Sat, 24 Feb 2018 13:40:18 +0900 Subject: Do not push status to feed if its reblog is already inserted (#6488) A complemental change for precompute_feed_service_spec.rb also fixes its random failure which is caused by the Snowlake randomization of the order of an original status and its reblog. --- spec/services/precompute_feed_service_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'spec/services/precompute_feed_service_spec.rb') diff --git a/spec/services/precompute_feed_service_spec.rb b/spec/services/precompute_feed_service_spec.rb index 396a3c3fb..43340bffc 100644 --- a/spec/services/precompute_feed_service_spec.rb +++ b/spec/services/precompute_feed_service_spec.rb @@ -9,14 +9,11 @@ RSpec.describe PrecomputeFeedService 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) - reblog = Fabricate(:status, account: followed_account) - status = Fabricate(:status, account: account, reblog: reblog) + status = Fabricate(:status, account: account) subject.call(account) - expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to be_within(0.1).of(status.id.to_f) + expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), status.id)).to be_within(0.1).of(status.id.to_f) end it 'does not raise an error even if it could not find any status' do -- cgit