Files
manyfold/spec/serializers/activity_pub/generic_activity_pub_serializer_shared.rb
T
James Smith 77ba123cbe Include toot:discoverable in ActivityPub responses
Currently controller by same option as `indexable`, so there's no specific separate choice for the user. Resolves #4688
2025-09-11 17:16:00 +01:00

38 lines
1.0 KiB
Ruby

shared_examples "GenericActivityPubSerializer" do
it "includes caption in summary" do
expect(ap[:summary]).to include object.caption
end
it "includes notes in content" do
expect(ap[:content]).to include object.notes
end
it "includes links as attachments" do
expect(ap[:attachment]).to include({type: "Link", href: "http://example.com"})
end
it "includes inherited indexable flag" do
allow(SiteSettings).to receive(:default_indexable).and_return(false)
object.update!(indexable: "inherit")
expect(ap).to include({
indexable: false
})
end
it "includes explicit indexable flag" do
allow(SiteSettings).to receive(:default_indexable).and_return(false)
object.update!(indexable: "yes")
expect(ap).to include({
indexable: true
})
end
it "includes discoverable flag set to same as indexable" do
allow(SiteSettings).to receive(:default_indexable).and_return(false)
object.update!(indexable: "yes")
expect(ap).to include({
discoverable: true
})
end
end