1
0
Fork 0
forked from gitea/nas

Add coverage for misc serializers (#32781)

This commit is contained in:
Matt Jankowski 2024-11-07 10:37:26 -05:00 committed by GitHub
parent 41227aeb95
commit 870bb06994
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 344 additions and 0 deletions

View file

@ -0,0 +1,39 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe ActivityPub::ActorSerializer do
subject { serialized_record_json(record, described_class) }
describe '#type' do
context 'with the instance actor' do
let(:record) { Account.find(Account::INSTANCE_ACTOR_ID) }
it { is_expected.to include('type' => 'Application') }
end
context 'with an application actor' do
let(:record) { Fabricate :account, actor_type: 'Application' }
it { is_expected.to include('type' => 'Service') }
end
context 'with a service actor' do
let(:record) { Fabricate :account, actor_type: 'Service' }
it { is_expected.to include('type' => 'Service') }
end
context 'with a Group actor' do
let(:record) { Fabricate :account, actor_type: 'Group' }
it { is_expected.to include('type' => 'Group') }
end
context 'with a Person actor' do
let(:record) { Fabricate :account, actor_type: 'Person' }
it { is_expected.to include('type' => 'Person') }
end
end
end