summaryrefslogtreecommitdiff
path: root/test/object
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-06-03 09:12:17 -0500
committerMark Felder <feld@FreeBSD.org>2019-06-03 09:12:17 -0500
commitf4e2595592ccca6cedd64669baef7bdd2a6547d0 (patch)
tree6806a79345c7599b0d436df8b6c46e75b54d1292 /test/object
parent3c4cab9be18ff543d025177b418ddd0b16050e68 (diff)
parent9789e000b05621435dc0c03833f564481e0b80e6 (diff)
downloadpleroma-f4e2595592ccca6cedd64669baef7bdd2a6547d0.tar.gz
pleroma-f4e2595592ccca6cedd64669baef7bdd2a6547d0.zip
Merge branch 'develop' into update-oauth-template
Diffstat (limited to 'test/object')
-rw-r--r--test/object/fetcher_test.exs19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/object/fetcher_test.exs b/test/object/fetcher_test.exs
index 72f616782..d604fd5f5 100644
--- a/test/object/fetcher_test.exs
+++ b/test/object/fetcher_test.exs
@@ -87,4 +87,23 @@ defmodule Pleroma.Object.FetcherTest do
)
end
end
+
+ describe "pruning" do
+ test "it can refetch pruned objects" do
+ object_id = "http://mastodon.example.org/@admin/99541947525187367"
+
+ {:ok, object} = Fetcher.fetch_object_from_id(object_id)
+
+ assert object
+
+ {:ok, _object} = Object.prune(object)
+
+ refute Object.get_by_ap_id(object_id)
+
+ {:ok, %Object{} = object_two} = Fetcher.fetch_object_from_id(object_id)
+
+ assert object.data["id"] == object_two.data["id"]
+ assert object.id != object_two.id
+ end
+ end
end