Fix multiple issues in quoted posts hydration (#34864)
This commit is contained in:
parent
44d71d59ef
commit
32b521b7f4
2 changed files with 67 additions and 16 deletions
|
@ -50,6 +50,7 @@ RSpec.describe StatusCacheHydrator do
|
|||
it 'renders the same attributes as full render' do
|
||||
expect(subject).to eql(compare_to_hash)
|
||||
expect(subject[:quote]).to_not be_nil
|
||||
expect(subject[:quote_status]).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -65,6 +66,48 @@ RSpec.describe StatusCacheHydrator do
|
|||
expect(subject[:quote]).to_not be_nil
|
||||
end
|
||||
|
||||
context 'when the quote post is recursive' do
|
||||
let(:quoted_status) { status }
|
||||
|
||||
it 'renders the same attributes as full render' do
|
||||
expect(subject).to eql(compare_to_hash)
|
||||
expect(subject[:quote]).to_not be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the quoted post has been deleted' do
|
||||
let(:quoted_status) { nil }
|
||||
|
||||
it 'returns the same attributes as full render' do
|
||||
expect(subject).to eql(compare_to_hash)
|
||||
expect(subject[:quote]).to_not be_nil
|
||||
expect(subject[:quote_status]).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the quoted post author has blocked the viewer' do
|
||||
before do
|
||||
quoted_status.account.block!(account)
|
||||
end
|
||||
|
||||
it 'returns the same attributes as full render' do
|
||||
expect(subject).to eql(compare_to_hash)
|
||||
expect(subject[:quote]).to_not be_nil
|
||||
expect(subject[:quote_status]).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the viewer has blocked the quoted post author' do
|
||||
before do
|
||||
account.block!(quoted_status.account)
|
||||
end
|
||||
|
||||
it 'returns the same attributes as full render' do
|
||||
expect(subject).to eql(compare_to_hash)
|
||||
expect(subject[:quote]).to_not be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the quoted post has been favourited' do
|
||||
before do
|
||||
FavouriteService.new.call(account, quoted_status)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue