projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into issue/1276-2
[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 8cd7636a54dbb56efbd2d2090b73c7890dbde01e..63b204387354a7be9c3d892160440809627ab879 100644
(file)
--- a/
test/web/mastodon_api/views/poll_view_test.exs
+++ b/
test/web/mastodon_api/views/poll_view_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.PollViewTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.PollViewTest do
@@
-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