diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-02-09 17:34:48 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-02-09 17:34:48 +0300 |
commit | 24e49d14f287b0daf8c2977f2228be09139e4bf3 (patch) | |
tree | f3a220c3afef989da503215c2991eb9687431791 /test | |
parent | 6ea3c06d8d42cd92b23c6de2d041db1cfea63b5a (diff) | |
download | pleroma-24e49d14f287b0daf8c2977f2228be09139e4bf3.tar.gz pleroma-24e49d14f287b0daf8c2977f2228be09139e4bf3.zip |
[#1505] Removed wrapping of reply URIs into `first` element, added comments to transmogrifier tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 8 | ||||
-rw-r--r-- | test/web/activity_pub/views/object_view_test.exs | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index d373762ea..7d9828d38 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -1361,6 +1361,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do %{data: data, items: items, collection: collection} end + # Mastodon wraps reply URIs in `replies->first->items` test "with wrapped `replies` collection, it schedules background fetching of items", %{ data: data, items: items, @@ -1378,6 +1379,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do end end + # Pleroma outputs reply URIs as `replies->items` test "it schedules background fetching of unwrapped `replies` collection items", %{ data: data, items: items, @@ -2135,10 +2137,8 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do object = Object.normalize(activity) replies_uris = Enum.map([self_reply1, self_reply2], fn a -> a.object.data["id"] end) - assert %{ - "type" => "Collection", - "first" => %{"type" => "Collection", "items" => ^replies_uris} - } = Transmogrifier.set_replies(object.data)["replies"] + assert %{"type" => "Collection", "items" => ^replies_uris} = + Transmogrifier.set_replies(object.data)["replies"] end end end diff --git a/test/web/activity_pub/views/object_view_test.exs b/test/web/activity_pub/views/object_view_test.exs index a9197b0c5..acc855b98 100644 --- a/test/web/activity_pub/views/object_view_test.exs +++ b/test/web/activity_pub/views/object_view_test.exs @@ -51,10 +51,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do replies_uris = [self_reply1.object.data["id"]] result = ObjectView.render("object.json", %{object: refresh_record(activity)}) - assert %{ - "type" => "Collection", - "first" => %{"type" => "Collection", "items" => ^replies_uris} - } = get_in(result, ["object", "replies"]) + assert %{"type" => "Collection", "items" => ^replies_uris} = + get_in(result, ["object", "replies"]) end end |