Merge commit '32b521b7f4055ccd4e59587589c2bed7759537cb' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2025-05-31 17:32:57 +02:00
2 changed files with 67 additions and 16 deletions

View File

@@ -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)