aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-01-22 09:47:59 -0600
committerMark Felder <feld@feld.me>2021-01-22 09:47:59 -0600
commit6bfd497f4afeb4182cc865087e6f4863bc48a4f4 (patch)
treed48c9c04ff0c83b85d2ff0bae7c940a8f4b14543 /test
parentd8860eaee46c9bc0a079e90dfb008c54923d7330 (diff)
downloadpleroma-6bfd497f4afeb4182cc865087e6f4863bc48a4f4.tar.gz
Include own_votes in the poll data
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/views/poll_view_test.exs6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/pleroma/web/mastodon_api/views/poll_view_test.exs b/test/pleroma/web/mastodon_api/views/poll_view_test.exs
index a8600e1c2..f087d50e8 100644
--- a/test/pleroma/web/mastodon_api/views/poll_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/poll_view_test.exs
@@ -44,7 +44,8 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do
],
voted: false,
votes_count: 0,
- voters_count: 0
+ voters_count: 0,
+ own_votes: []
}
result = PollView.render("show.json", %{object: object})
@@ -123,7 +124,10 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do
result = PollView.render("show.json", %{object: object, for: other_user})
+ _own_votes = result[:own_votes]
+
assert result[:voted] == true
+ assert own_votes = [1, 2]
assert Enum.at(result[:options], 1)[:votes_count] == 1
assert Enum.at(result[:options], 2)[:votes_count] == 1
end