summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/views
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-04-24 18:37:58 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-04-24 18:37:58 +0400
commitc56c0a3d23929f166f4d95e5c6e96bbf0df8a35e (patch)
tree6b6fffe4faeebbf7e103d16a427f6f68774b44d5 /test/web/mastodon_api/views
parent364eecc49f137ae3c7798ad240983591e27b134c (diff)
parent2430b9bf90d6fde71885f5f0f8be767526be6208 (diff)
downloadpleroma-c56c0a3d23929f166f4d95e5c6e96bbf0df8a35e.tar.gz
pleroma-c56c0a3d23929f166f4d95e5c6e96bbf0df8a35e.zip
Merge branch 'develop' into global-status-expiration
Diffstat (limited to 'test/web/mastodon_api/views')
-rw-r--r--test/web/mastodon_api/views/poll_view_test.exs16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/web/mastodon_api/views/poll_view_test.exs b/test/web/mastodon_api/views/poll_view_test.exs
index 6211fa888..63b204387 100644
--- a/test/web/mastodon_api/views/poll_view_test.exs
+++ b/test/web/mastodon_api/views/poll_view_test.exs
@@ -43,7 +43,8 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do
%{title: "why are you even asking?", votes_count: 0}
],
voted: false,
- votes_count: 0
+ votes_count: 0,
+ voters_count: nil
}
result = PollView.render("show.json", %{object: object})
@@ -69,9 +70,20 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do
}
})
+ voter = insert(:user)
+
object = Object.normalize(activity)
- assert %{multiple: true} = PollView.render("show.json", %{object: object})
+ {:ok, _votes, object} = CommonAPI.vote(voter, object, [0, 1])
+
+ assert match?(
+ %{
+ multiple: true,
+ voters_count: 1,
+ votes_count: 2
+ },
+ PollView.render("show.json", %{object: object})
+ )
end
test "detects emoji" do