diff options
author | David Yip <yipdw@member.fsf.org> | 2017-10-16 09:23:59 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-10-16 09:23:59 -0500 |
commit | dbb1fce94dbd877d795898933ca344359f9b74c1 (patch) | |
tree | 06ab5f2ae7714b41aa9e5cc19ac8c234e0f394be /spec/lib | |
parent | 6cd5b3bbe5a11fcf25bbefba2803f2ae840f39fc (diff) | |
parent | aec70b44fc551db6471c8bc5210688b154ac661f (diff) |
Merge remote-tracking branch 'upstream/master' into gs-master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/feed_manager_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index 923894ccb..643f1f003 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -233,19 +233,22 @@ RSpec.describe FeedManager do describe '#unpush' do it 'leaves a reblogged status when deleting the reblog' do account = Fabricate(:account) - reblogged = Fabricate(:status) + reblogged = Fabricate(:status, id: Mastodon::Snowflake.id_at(2.day.ago.utc)) + other_status = Fabricate(:status, id: Mastodon::Snowflake.id_at(1.day.ago.utc)) status = Fabricate(:status, reblog: reblogged) + FeedManager.instance.push('type', account, other_status) FeedManager.instance.push('type', account, status) # The reblogging status should show up under normal conditions. - expect(Redis.current.zrange("feed:type:#{account.id}", 0, -1)).to eq [status.id.to_s] + expect(Redis.current.zrange("feed:type:#{account.id}", 0, -1)).to eq [other_status.id.to_s, status.id.to_s] FeedManager.instance.unpush('type', account, status) # Because we couldn't tell if the status showed up any other way, # we had to stick the reblogged status in by itself. - expect(Redis.current.zrange("feed:type:#{account.id}", 0, -1)).to eq [reblogged.id.to_s] + # And it must be ordered by status ids. + expect(Redis.current.zrange("feed:type:#{account.id}", 0, -1)).to eq [reblogged.id.to_s, other_status.id.to_s] end it 'sends push updates' do |