Merge branch 'feature/return-link-for-password-reset' into 'develop'
[akkoma] / test / web / mastodon_api / views / status_view_test.exs
index 90451cbdc757ba8bfeee89113c9c6d991bfe956a..51f8434fad2f7bc24637a89361d235bf49bfc797 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
@@ -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