summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-09-25 10:48:01 -0500
committerMark Felder <feld@FreeBSD.org>2020-09-25 10:48:01 -0500
commit2bf2c68dee1385cba906fe95bd2af3afd2a341b9 (patch)
treed9c1fed6298705d59c5108d52e452922fbdd699b /test/web/common_api/common_api_test.exs
parent88653c01c92fffb396e32edad203d18607980c04 (diff)
parent5cd71208d9b273535f978559011377e703e82dcb (diff)
downloadpleroma-2bf2c68dee1385cba906fe95bd2af3afd2a341b9.tar.gz
pleroma-2bf2c68dee1385cba906fe95bd2af3afd2a341b9.zip
Merge branch 'develop' into fix/deprecation-warning-welcome-message
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)