diff options
author | rinpatch <rinpatch@sdf.org> | 2019-05-15 20:10:16 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-05-15 20:10:16 +0300 |
commit | 62e42b03abd2cede85e85f62c35f62a8c42e8ea1 (patch) | |
tree | 6390769e82ff7f665ac850578d63628b98b31b8e /test/web | |
parent | 131f88320740bec9c74e4280a6b1a7d8641ee367 (diff) | |
download | pleroma-62e42b03abd2cede85e85f62c35f62a8c42e8ea1.tar.gz pleroma-62e42b03abd2cede85e85f62c35f62a8c42e8ea1.zip |
Handle incoming Question objects
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index c24b50f8c..727abbd17 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -113,6 +113,23 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do assert Enum.at(object.data["tag"], 2) == "moo" end + test "it works for incoming questions" do + data = File.read!("test/fixtures/mastodon-question-activity.json") |> Poison.decode!() + + {:ok, %Activity{local: false} = activity} = Transmogrifier.handle_incoming(data) + + object = Object.normalize(activity) + + assert Enum.all?(object.data["oneOf"], fn choice -> + choice["name"] in [ + "Dunno", + "Everyone knows that!", + "25 char limit is dumb", + "I can't even fit a funny" + ] + end) + end + test "it works for incoming notices with contentMap" do data = File.read!("test/fixtures/mastodon-post-activity-contentmap.json") |> Poison.decode!() |