mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
CommonAPI test: Add test for polls
This commit is contained in:
parent
02f12ec625
commit
35d62a4a56
1 changed files with 17 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue