summaryrefslogtreecommitdiff
path: root/test/web
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-09-05 09:11:16 +0000
committerrinpatch <rinpatch@sdf.org>2019-09-05 09:11:16 +0000
commit9d4fc9aa3549ed86c6af664dc358e3bcbe74f862 (patch)
tree63c2f1f18be81cc666ff3f845aa568422419bf18 /test/web
parent3e30f6e19824dc90717fc0929feddb24220a89ab (diff)
parentb312ca3d528305ebc3b0c72799af535a406ce251 (diff)
downloadpleroma-9d4fc9aa3549ed86c6af664dc358e3bcbe74f862.tar.gz
pleroma-9d4fc9aa3549ed86c6af664dc358e3bcbe74f862.zip
Merge branch 'fix/endless-poll-handling' into 'develop'
Mastodon API Poll view: Fix handling of polls without an end date See merge request pleroma/pleroma!1631
Diffstat (limited to 'test/web')
-rw-r--r--test/web/mastodon_api/views/status_view_test.exs8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs
index 90451cbdc..fcdd7fbcb 100644
--- a/test/web/mastodon_api/views/status_view_test.exs
+++ b/test/web/mastodon_api/views/status_view_test.exs
@@ -551,6 +551,14 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert Enum.at(result[:options], 1)[:votes_count] == 1
assert Enum.at(result[:options], 2)[:votes_count] == 1
end
+
+ test "does not crash on polls with no end date" do
+ object = Object.normalize("https://skippers-bin.com/notes/7x9tmrp97i")
+ result = StatusView.render("poll.json", %{object: object})
+
+ assert result[:expires_at] == nil
+ assert result[:expired] == false
+ end
end
test "embeds a relationship in the account" do