mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-03-05 00:10:54 -08:00
Accept remote quotes of local quotes according to set policy (#35629)
This commit is contained in:
parent
0153a239db
commit
32791c9745
5 changed files with 110 additions and 3 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue