|
|
|
@ -67,7 +67,7 @@ RSpec.describe ActivityPub::Activity::Create do |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'public' do |
|
|
|
|
context 'public with explicit public address' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, |
|
|
|
@ -85,7 +85,43 @@ RSpec.describe ActivityPub::Activity::Create do |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'unlisted' do |
|
|
|
|
context 'public with as:Public' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, |
|
|
|
|
type: 'Note', |
|
|
|
|
content: 'Lorem ipsum', |
|
|
|
|
to: 'as:Public', |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'creates status' do |
|
|
|
|
status = sender.statuses.first |
|
|
|
|
|
|
|
|
|
expect(status).to_not be_nil |
|
|
|
|
expect(status.visibility).to eq 'public' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'public with Public' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, |
|
|
|
|
type: 'Note', |
|
|
|
|
content: 'Lorem ipsum', |
|
|
|
|
to: 'Public', |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'creates status' do |
|
|
|
|
status = sender.statuses.first |
|
|
|
|
|
|
|
|
|
expect(status).to_not be_nil |
|
|
|
|
expect(status.visibility).to eq 'public' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'unlisted with explicit public address' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, |
|
|
|
@ -103,6 +139,42 @@ RSpec.describe ActivityPub::Activity::Create do |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'unlisted with as:Public' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, |
|
|
|
|
type: 'Note', |
|
|
|
|
content: 'Lorem ipsum', |
|
|
|
|
cc: 'as:Public', |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'creates status' do |
|
|
|
|
status = sender.statuses.first |
|
|
|
|
|
|
|
|
|
expect(status).to_not be_nil |
|
|
|
|
expect(status.visibility).to eq 'unlisted' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'unlisted with Public' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, |
|
|
|
|
type: 'Note', |
|
|
|
|
content: 'Lorem ipsum', |
|
|
|
|
cc: 'Public', |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'creates status' do |
|
|
|
|
status = sender.statuses.first |
|
|
|
|
|
|
|
|
|
expect(status).to_not be_nil |
|
|
|
|
expect(status.visibility).to eq 'unlisted' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'private' do |
|
|
|
|
let(:object_json) do |
|
|
|
|
{ |
|
|
|
|