Handle incoming deletes.
This commit is contained in:
parent
1377b2e569
commit
d2ad99298e
3 changed files with 65 additions and 13 deletions
|
|
@ -148,6 +148,23 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
assert user.info["banner"]["url"] == [%{"href" => "https://cd.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"}]
|
||||
assert user.bio == "<p>Some bio</p>"
|
||||
end
|
||||
|
||||
test "it works for incoming deletes" do
|
||||
activity = insert(:note_activity)
|
||||
data = File.read!("test/fixtures/mastodon-delete.json")
|
||||
|> Poison.decode!
|
||||
|
||||
object = data["object"]
|
||||
|> Map.put("id", activity.data["object"]["id"])
|
||||
|
||||
data = data
|
||||
|> Map.put("object", object)
|
||||
|> Map.put("actor", activity.data["actor"])
|
||||
|
||||
{:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
|
||||
|
||||
refute Repo.get(Activity, activity.id)
|
||||
end
|
||||
end
|
||||
|
||||
describe "prepare outgoing" do
|
||||
|
|
@ -256,18 +273,5 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
refute Repo.get(WebsubClientSubscription, ws.id)
|
||||
assert Repo.get(WebsubClientSubscription, ws2.id)
|
||||
end
|
||||
|
||||
test "it deletes all websub server subscriptions with the server as callback" do
|
||||
subscription = %WebsubClientSubscription{topic: "https://niu.moe/users/rye.atom"}
|
||||
{:ok, ws} = Repo.insert(subscription)
|
||||
|
||||
subscription = %WebsubClientSubscription{topic: "https://niu.moe/users/pasty.atom"}
|
||||
{:ok, ws2} = Repo.insert(subscription)
|
||||
|
||||
Transmogrifier.maybe_retire_websub("https://niu.moe/users/rye")
|
||||
|
||||
refute Repo.get(WebsubClientSubscription, ws.id)
|
||||
assert Repo.get(WebsubClientSubscription, ws2.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue