Add limited_scope support
This commit is contained in:
parent
ec16074def
commit
c1f6d22ad2
17 changed files with 107 additions and 10 deletions
|
@ -290,6 +290,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
|
||||
expect(status).to_not be_nil
|
||||
expect(status.visibility).to eq 'limited'
|
||||
expect(status.limited_scope).to eq 'none'
|
||||
end
|
||||
|
||||
it 'creates silent mention' do
|
||||
|
@ -298,6 +299,50 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when limited_scope' do
|
||||
let(:recipient) { Fabricate(:account) }
|
||||
|
||||
let(:object_json) do
|
||||
{
|
||||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||
type: 'Note',
|
||||
content: 'Lorem ipsum',
|
||||
to: ActivityPub::TagManager.instance.uri_for(recipient),
|
||||
limitedScope: 'Mutual',
|
||||
}
|
||||
end
|
||||
|
||||
it 'creates status' do
|
||||
status = sender.statuses.first
|
||||
|
||||
expect(status).to_not be_nil
|
||||
expect(status.visibility).to eq 'limited'
|
||||
expect(status.limited_scope).to eq 'mutual'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when invalid limited_scope' do
|
||||
let(:recipient) { Fabricate(:account) }
|
||||
|
||||
let(:object_json) do
|
||||
{
|
||||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||
type: 'Note',
|
||||
content: 'Lorem ipsum',
|
||||
to: ActivityPub::TagManager.instance.uri_for(recipient),
|
||||
limitedScope: 'IdosdsazsF',
|
||||
}
|
||||
end
|
||||
|
||||
it 'creates status' do
|
||||
status = sender.statuses.first
|
||||
|
||||
expect(status).to_not be_nil
|
||||
expect(status.visibility).to eq 'limited'
|
||||
expect(status.limited_scope).to eq 'none'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when direct' do
|
||||
let(:recipient) { Fabricate(:account) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue