0
0
Fork 0

Consolidate JSON parsing in serializers specs (#27693)

This commit is contained in:
Matt Jankowski 2023-11-07 10:20:24 -05:00 committed by GitHub
parent a688a9ed20
commit 1d51e10510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 25 additions and 84 deletions

View file

@ -3,7 +3,7 @@
require 'rails_helper'
describe ActivityPub::NoteSerializer do
subject { JSON.parse(@serialization.to_json) }
subject { serialized_record_json(parent, described_class, adapter: ActivityPub::Adapter) }
let!(:account) { Fabricate(:account) }
let!(:other) { Fabricate(:account) }
@ -14,10 +14,6 @@ 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) }
before do
@serialization = ActiveModelSerializers::SerializableResource.new(parent, serializer: described_class, adapter: ActivityPub::Adapter)
end
it 'has the expected shape' do
expect(subject).to include({
'@context' => include('https://www.w3.org/ns/activitystreams'),