aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-01-19 23:44:08 +0000
committerkaniini <nenolod@gmail.com>2019-01-19 23:44:08 +0000
commit42612b1c8d356843b9e8785d3a91072f38fb50cf (patch)
tree5fa0c64c8ba26e2e30c0f7364059615a94bea7e3 /test
parent651ce1c97bf0754f170032b47abcb19ac0794e74 (diff)
parent31517bec129df1958de871bded16e2d637d8d6e0 (diff)
downloadpleroma-42612b1c8d356843b9e8785d3a91072f38fb50cf.tar.gz
Merge branch 'bugfix/improve-boost-targeting' into 'develop'
improve handling of non-public Announces See merge request pleroma/pleroma!681
Diffstat (limited to 'test')
-rw-r--r--test/web/activity_pub/transmogrifier_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs
index 87d0ab559..6107ac4f7 100644
--- a/test/web/activity_pub/transmogrifier_test.exs
+++ b/test/web/activity_pub/transmogrifier_test.exs
@@ -288,6 +288,22 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
assert Activity.get_create_activity_by_object_ap_id(data["object"]).id == activity.id
end
+ test "it does not clobber the addressing on announce activities" do
+ user = insert(:user)
+ {:ok, activity} = CommonAPI.post(user, %{"status" => "hey"})
+
+ data =
+ File.read!("test/fixtures/mastodon-announce.json")
+ |> Poison.decode!()
+ |> Map.put("object", activity.data["object"]["id"])
+ |> Map.put("to", ["http://mastodon.example.org/users/admin/followers"])
+ |> Map.put("cc", [])
+
+ {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
+
+ assert data["to"] == ["http://mastodon.example.org/users/admin/followers"]
+ end
+
test "it works for incoming update activities" do
data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode!()