Consolidate JSON parsing in serializers specs (#27693)
This commit is contained in:
parent
a688a9ed20
commit
1d51e10510
15 changed files with 25 additions and 84 deletions
|
@ -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'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue