0
0
Fork 0

Fix media attachment order of remote posts (#28469)

This commit is contained in:
Claire 2023-12-22 16:10:39 +01:00 committed by GitHub
parent a4d49c236d
commit 2bf84b93d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View file

@ -532,15 +532,21 @@ RSpec.describe ActivityPub::Activity::Create do
mediaType: 'image/png',
url: 'http://example.com/attachment.png',
},
{
type: 'Document',
mediaType: 'image/png',
url: 'http://example.com/emoji.png',
},
],
}
end
it 'creates status' do
it 'creates status with correctly-ordered media attachments' do
status = sender.statuses.first
expect(status).to_not be_nil
expect(status.media_attachments.map(&:remote_url)).to include('http://example.com/attachment.png')
expect(status.ordered_media_attachments.map(&:remote_url)).to eq ['http://example.com/attachment.png', 'http://example.com/emoji.png']
expect(status.ordered_media_attachment_ids).to be_present
end
end