summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-10-05 12:40:53 -0500
committerMark Felder <feld@FreeBSD.org>2020-10-05 12:40:53 -0500
commit346cc3ac244384d37d1bcbbe888173725465a307 (patch)
tree61947d678e4f0a1be1a71e68f0bf4f03301eb725 /test/web/common_api/common_api_test.exs
parent3f201475e099aecf0c77ca5396b114433ea58224 (diff)
parent4b05eb9a321ebdc03588f786683e83427fe31f1c (diff)
downloadpleroma-346cc3ac244384d37d1bcbbe888173725465a307.tar.gz
pleroma-346cc3ac244384d37d1bcbbe888173725465a307.zip
Merge branch 'develop' into feature/1893-remote-emoji-packs-pagination
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 2eab64e8b..e34f5a49b 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -29,6 +29,23 @@ defmodule Pleroma.Web.CommonAPITest do
setup do: clear_config([:instance, :limit])
setup do: clear_config([:instance, :max_pinned_statuses])
+ describe "posting polls" do
+ test "it posts a poll" do
+ user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post(user, %{
+ status: "who is the best",
+ poll: %{expires_in: 600, options: ["reimu", "marisa"]}
+ })
+
+ object = Object.normalize(activity)
+
+ assert object.data["type"] == "Question"
+ assert object.data["oneOf"] |> length() == 2
+ end
+ end
+
describe "blocking" do
setup do
blocker = insert(:user)