diff options
| author | Sachin Joshi <satchin.joshi@gmail.com> | 2019-06-01 11:42:37 +0545 |
|---|---|---|
| committer | Sachin Joshi <satchin.joshi@gmail.com> | 2019-06-01 11:42:37 +0545 |
| commit | ad5263c647aea65dbeb4c329825671895e0a8863 (patch) | |
| tree | 6217011a3fd2ea943498ce296de07cefe1206b87 /test/object | |
| parent | 5534d4c67675901ab272ee47355ad43dfae99033 (diff) | |
| parent | f1890d2cacfa09dd22b06a8d041c04dbeba9e138 (diff) | |
| download | pleroma-ad5263c647aea65dbeb4c329825671895e0a8863.tar.gz pleroma-ad5263c647aea65dbeb4c329825671895e0a8863.zip | |
Merge remote-tracking branch 'upstream/develop' into admin-create-users
Diffstat (limited to 'test/object')
| -rw-r--r-- | test/object/fetcher_test.exs | 19 |
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 |
