Add: fep-e232引用仕様 (#725)

* Add: fep-e232引用仕様

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-04-23 19:48:16 +09:00 committed by GitHub
parent eb28fa8e53
commit f29f3c5c85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 5 deletions

View file

@ -16,11 +16,14 @@ describe ActivityPub::NoteSerializer do
let!(:reply_by_account_third) { Fabricate(:status, account: account, thread: parent, visibility: :public) }
let!(:reply_by_account_visibility_direct) { Fabricate(:status, account: account, thread: parent, visibility: :direct) }
let!(:referred) { nil }
let!(:referred2) { nil }
let!(:quote) { nil }
before do
parent.references << referred if referred.present?
parent.references << referred2 if referred2.present?
if quote.present?
parent.references << quote
parent.quote = quote
end
end
it 'has the expected shape' do
@ -78,7 +81,7 @@ describe ActivityPub::NoteSerializer do
end
end
context 'when has quote but no_convert setting' do
context 'when has a reference' do
let(:referred) { Fabricate(:status) }
it 'has a references collection' do
@ -94,4 +97,19 @@ describe ActivityPub::NoteSerializer do
expect(subject['references']['first']['items']).to include referred.uri
end
end
context 'when has a quote' do
let(:quote) { Fabricate(:status) }
it 'has a quote as transitional type' do
expect(subject['quoteUri']).to eq ActivityPub::TagManager.instance.uri_for(quote)
end
it 'has a quote as feb-e232 object link' do
tag = subject['tag'].detect { |t| t['type'] == 'Link' }
expect(tag).to_not be_nil
expect(tag['mediaType']).to eq 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
expect(tag['href']).to eq ActivityPub::TagManager.instance.uri_for(quote)
end
end
end