diff options
author | lain <lain@soykaf.club> | 2020-05-12 14:35:51 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-12 14:35:51 +0000 |
commit | be5d0a9bdef80d24a98ca23c08bb596798281314 (patch) | |
tree | 5f60ac5f1a1a275ea5526a73e629dfc38d16e4ef /test/web/activity_pub | |
parent | d17040e9976976a182e428aff1baa6225a906e53 (diff) | |
parent | dfb90a1fd64cfb8f81707d939a87a02e8047dc3b (diff) | |
download | pleroma-be5d0a9bdef80d24a98ca23c08bb596798281314.tar.gz pleroma-be5d0a9bdef80d24a98ca23c08bb596798281314.zip |
Merge branch '1020-honk-announces' into 'develop'
Transmogrifier: Add tests for certain announces
Closes #1020
See merge request pleroma/pleroma!2516
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 2914c90ea..34e77fa79 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -260,6 +260,24 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do "<p>henlo from my Psion netBook</p><p>message sent from my Psion netBook</p>" end + test "it works for incoming honk announces" do + _user = insert(:user, ap_id: "https://honktest/u/test", local: false) + other_user = insert(:user) + {:ok, post} = CommonAPI.post(other_user, %{"status" => "bonkeronk"}) + + announce = %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "actor" => "https://honktest/u/test", + "id" => "https://honktest/u/test/bonk/1793M7B9MQ48847vdx", + "object" => post.data["object"], + "published" => "2019-06-25T19:33:58Z", + "to" => "https://www.w3.org/ns/activitystreams#Public", + "type" => "Announce" + } + + {:ok, %Activity{local: false}} = Transmogrifier.handle_incoming(announce) + end + test "it works for incoming announces with actor being inlined (kroeg)" do data = File.read!("test/fixtures/kroeg-announce-with-inline-actor.json") |> Poison.decode!() |