Accept remote quotes of local quotes according to set policy (#35629)

This commit is contained in:
Claire 2025-08-04 17:27:46 +02:00 committed by GitHub
parent 0153a239db
commit 32791c9745
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 110 additions and 3 deletions

View file

@ -0,0 +1,25 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe ActivityPub::AcceptQuoteRequestSerializer do
subject { serialized_record_json(record, described_class, adapter: ActivityPub::Adapter) }
describe 'serializing an object' do
let(:record) { Fabricate(:quote, state: :accepted) }
it 'returns expected attributes' do
expect(subject.deep_symbolize_keys)
.to include(
actor: eq(ActivityPub::TagManager.instance.uri_for(record.quoted_account)),
id: match("#accepts/quote_requests/#{record.id}"),
object: include(
type: 'QuoteRequest',
instrument: ActivityPub::TagManager.instance.uri_for(record.status),
object: ActivityPub::TagManager.instance.uri_for(record.quoted_status)
),
type: 'Accept'
)
end
end
end