diff options
author | lain <lain@soykaf.club> | 2018-02-25 10:56:01 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-02-25 10:56:01 +0100 |
commit | b76de1ecd3def57fb716ca25d44bee398ee4d8e1 (patch) | |
tree | dd96b75cbadbbba6ba4a04b66d09dad870aa27a9 /test | |
parent | 0e9bd6d1485e56f81da8fcde6b40d8981f63b113 (diff) | |
download | pleroma-b76de1ecd3def57fb716ca25d44bee398ee4d8e1.tar.gz pleroma-b76de1ecd3def57fb716ca25d44bee398ee4d8e1.zip |
Some fixes to AP fetching.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 2e500d11d..43cc94e5f 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -36,7 +36,27 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do {:ok, returned_activity} = Transmogrifier.handle_incoming(data) - assert Activity.get_create_activity_by_object_ap_id("tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment") + assert activity = Activity.get_create_activity_by_object_ap_id("tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment") + assert returned_activity.data["object"]["inReplyToAtomUri"] == "https://shitposter.club/notice/2827873" + assert returned_activity.data["object"]["inReplyToStatusId"] == activity.id + end + + test "it works if the activity id isn't an url but an atom-uri is given" do + data = File.read!("test/fixtures/mastodon-post-activity.json") + |> Poison.decode! + + object = data["object"] + |> Map.put("inReplyToAtomUri", "https://shitposter.club/notice/2827873") + |> Map.put("inReplyTo", "tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment") + + data = data + |> Map.put("object", object) + + {:ok, returned_activity} = Transmogrifier.handle_incoming(data) + + assert activity = Activity.get_create_activity_by_object_ap_id("tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment") + assert returned_activity.data["object"]["inReplyToAtomUri"] == "https://shitposter.club/notice/2827873" + assert returned_activity.data["object"]["inReplyToStatusId"] == activity.id end test "it works for incoming notices" do |