mirror of https://github.com/mastodon/mastodon
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
Ruby
40 lines
1.0 KiB
Ruby
3 months ago
|
# 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
|