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,16 +3,12 @@
require 'rails_helper'
describe ActivityPub::UpdatePollSerializer do
subject { JSON.parse(@serialization.to_json) }
subject { serialized_record_json(status, described_class, adapter: ActivityPub::Adapter) }
let(:account) { Fabricate(:account) }
let(:poll) { Fabricate(:poll, account: account) }
let!(:status) { Fabricate(:status, account: account, poll: poll) }
before do
@serialization = ActiveModelSerializers::SerializableResource.new(status, serializer: described_class, adapter: ActivityPub::Adapter)
end
it 'has a Update type' do
expect(subject['type']).to eql('Update')
end