summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-09-24 09:41:28 +0000
committerlain <lain@soykaf.club>2020-09-24 09:41:28 +0000
commit47cd59342f0f82415b04e36e05741e0fcafdbdcc (patch)
tree01360e8107bc6f28429f768df4c8213c65c32b1b
parente02101e15c425416975f756aca7f3b058006668d (diff)
parent35d62a4a5602913de3a91582aa03d5af9ac7a5b0 (diff)
Merge branch 'smol-test' into 'develop'
CommonAPI test: Add test for polls See merge request pleroma/pleroma!3028
-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)