projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/voters-count' into 'develop'
[akkoma]
/
test
/
web
/
mastodon_api
/
views
/
poll_view_test.exs
diff --git
a/test/web/mastodon_api/views/poll_view_test.exs
b/test/web/mastodon_api/views/poll_view_test.exs
index 6211fa888758c92aa53733c899d2967c44dfbf7a..63b204387354a7be9c3d892160440809627ab879 100644
(file)
--- 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,
%{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})
}
result = PollView.render("show.json", %{object: object})
@@
-69,9
+70,20
@@
defmodule Pleroma.Web.MastodonAPI.PollViewTest do
}
})
}
})
+ voter = insert(:user)
+
object = Object.normalize(activity)
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
end
test "detects emoji" do