Sort self-replies to the top of descendants (#9320)

Fix #6463
This commit is contained in:
Eugen Rochko
2018-11-24 20:48:50 +01:00
committed by GitHub
parent 87a43274f1
commit 0eaf6d7693
2 changed files with 34 additions and 2 deletions

View File

@ -118,5 +118,15 @@ describe StatusThreadingConcern do
viewer.block_domain!('example.com')
expect(status.descendants(4, viewer)).to_not include(reply2)
end
it 'promotes self-replies to the top while leaving the rest in order' do
a = Fabricate(:status, account: alice)
d = Fabricate(:status, account: jeff, thread: a)
e = Fabricate(:status, account: bob, thread: d)
c = Fabricate(:status, account: alice, thread: a)
f = Fabricate(:status, account: bob, thread: c)
expect(a.descendants(20)).to eq [c, d, e, f]
end
end
end