Merge branch 'feature/create-tombstone-instead-of-delete' into 'develop'
Create tombstone instead of object deletion See merge request pleroma/pleroma!593
This commit is contained in:
commit
bee6acd51d
9 changed files with 53 additions and 13 deletions
|
|
@ -492,7 +492,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
|
||||
assert Repo.get(Activity, delete.id) != nil
|
||||
|
||||
assert Repo.get(Object, object.id) == nil
|
||||
assert Repo.get(Object, object.id).data["type"] == "Tombstone"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|
|||
|
||||
assert %{} = json_response(conn, 200)
|
||||
|
||||
assert Repo.get(Activity, activity.id) == nil
|
||||
refute Repo.get(Activity, activity.id)
|
||||
end
|
||||
|
||||
test "when you didn't create it", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
|
|||
|
||||
refute Repo.get(Activity, note.id)
|
||||
refute Repo.get(Activity, like.id)
|
||||
refute Object.get_by_ap_id(note.data["object"]["id"])
|
||||
assert Object.get_by_ap_id(note.data["object"]["id"]).data["type"] == "Tombstone"
|
||||
assert Repo.get(Activity, second_note.id)
|
||||
assert Object.get_by_ap_id(second_note.data["object"]["id"])
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
defmodule Pleroma.Web.OStatus.OStatusControllerTest do
|
||||
use Pleroma.Web.ConnCase
|
||||
import Pleroma.Factory
|
||||
alias Pleroma.{User, Repo}
|
||||
alias Pleroma.{User, Repo, Object}
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.Web.OStatus.ActivityRepresenter
|
||||
|
||||
|
|
@ -114,6 +114,22 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do
|
|||
|> response(404)
|
||||
end
|
||||
|
||||
test "404s on deleted objects", %{conn: conn} do
|
||||
note_activity = insert(:note_activity)
|
||||
[_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"]))
|
||||
object = Object.get_by_ap_id(note_activity.data["object"]["id"])
|
||||
|
||||
conn
|
||||
|> get("/objects/#{uuid}")
|
||||
|> response(200)
|
||||
|
||||
Object.delete(object)
|
||||
|
||||
conn
|
||||
|> get("/objects/#{uuid}")
|
||||
|> response(404)
|
||||
end
|
||||
|
||||
test "gets an activity", %{conn: conn} do
|
||||
note_activity = insert(:note_activity)
|
||||
[_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["id"]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue