actor_serializer_spec.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe ActivityPub::ActorSerializer do
  4. subject { serialized_record_json(record, described_class) }
  5. describe '#type' do
  6. context 'with the instance actor' do
  7. let(:record) { Account.find(Account::INSTANCE_ACTOR_ID) }
  8. it { is_expected.to include('type' => 'Application') }
  9. end
  10. context 'with an application actor' do
  11. let(:record) { Fabricate :account, actor_type: 'Application' }
  12. it { is_expected.to include('type' => 'Service') }
  13. end
  14. context 'with a service actor' do
  15. let(:record) { Fabricate :account, actor_type: 'Service' }
  16. it { is_expected.to include('type' => 'Service') }
  17. end
  18. context 'with a Group actor' do
  19. let(:record) { Fabricate :account, actor_type: 'Group' }
  20. it { is_expected.to include('type' => 'Group') }
  21. end
  22. context 'with a Person actor' do
  23. let(:record) { Fabricate :account, actor_type: 'Person' }
  24. it { is_expected.to include('type' => 'Person') }
  25. end
  26. end
  27. end