1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Add test for converted object type: Event with summary and other unconverted fields.

This commit is contained in:
André Menrath 2024-01-09 15:33:55 +01:00
parent d9aaf4e467
commit 71e1913e55

View file

@ -129,6 +129,33 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
end
end
context 'with Event object that contains' do
let(:object) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: 'https://foo.bar/@foo/1234',
type: 'Event',
name: "Let's change the world",
startTime: '2024-01-31T20:00:00.000+01:00',
location: {
type:'Place',
name: 'FooBar',
},
content: "Some description of the event object that does not get converted.",
summary: "We meet on January 31st at 8pm in the FooBaar!",
attributedTo: ActivityPub::TagManager.instance.uri_for(sender),
}
end
it 'creates status' do
status = sender.statuses.first
expect(status).to_not be_nil
expect(status.url).to eq 'https://foo.bar/@foo/1234'
expect(strip_tags(status.text)).to eq 'Let\'s change the world\n\nWe meet on January 31st at 8pm in the FooBaar!\n\nhttps://foo.bar/@foo/1234'
end
end
context 'with wrong id' do
let(:note) do
{