projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'manifest' into 'develop'
[akkoma]
/
test
/
pleroma
/
web
/
mastodon_api
/
views
/
poll_view_test.exs
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 f087d50e8a4b3c2d3a9ef1d52790871269d79f6b..224b26cb91db1593dd1c16e3c778fc8ece10b4df 100644
(file)
--- a/
test/pleroma/web/mastodon_api/views/poll_view_test.exs
+++ b/
test/pleroma/web/mastodon_api/views/poll_view_test.exs
@@
-42,10
+42,8
@@
defmodule Pleroma.Web.MastodonAPI.PollViewTest do
%{title: "yes", votes_count: 0},
%{title: "why are you even asking?", votes_count: 0}
],
%{title: "yes", votes_count: 0},
%{title: "why are you even asking?", votes_count: 0}
],
- voted: false,
votes_count: 0,
votes_count: 0,
- voters_count: 0,
- own_votes: []
+ voters_count: 0
}
result = PollView.render("show.json", %{object: object})
}
result = PollView.render("show.json", %{object: object})
@@
-124,10
+122,9
@@
defmodule Pleroma.Web.MastodonAPI.PollViewTest do
result = PollView.render("show.json", %{object: object, for: other_user})
result = PollView.render("show.json", %{object: object, for: other_user})
- _own_votes = result[:own_votes]
-
assert result[:voted] == true
assert result[:voted] == true
- assert own_votes = [1, 2]
+ assert 1 in result[:own_votes]
+ assert 2 in result[:own_votes]
assert Enum.at(result[:options], 1)[:votes_count] == 1
assert Enum.at(result[:options], 2)[:votes_count] == 1
end
assert Enum.at(result[:options], 1)[:votes_count] == 1
assert Enum.at(result[:options], 2)[:votes_count] == 1
end