diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2018-02-24 13:40:18 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-02-24 05:40:18 +0100 |
commit | f8f0572ee09122dd8fda51aec899f939c6ab03bf (patch) | |
tree | d723b5168ccb4a9be1d9e3ca1b85add74e0363d9 /spec/services | |
parent | e668180044560e28bdc5eef94744c210013efcda (diff) |
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.
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/precompute_feed_service_spec.rb | 7 |
1 files changed, 2 insertions, 5 deletions
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 |