diff options
author | lain <lain@soykaf.club> | 2018-11-03 16:28:29 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-11-03 16:28:29 +0100 |
commit | 81af7fd02d2ca0430e0470b78ad2384e5598fbe1 (patch) | |
tree | 8d0262fb328f7588520c5a5adcd7067f44429b4b /test | |
parent | 50f974b83b598a573307d144ce1614fae4c99969 (diff) | |
download | pleroma-81af7fd02d2ca0430e0470b78ad2384e5598fbe1.tar.gz |
Test for null-content activities.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index b9c019206..b29f13e20 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -7,6 +7,20 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do alias Pleroma.Web.CommonAPI import Pleroma.Factory + test "a note with null content" do + note = insert(:note_activity) + data = note.data + |> put_in(["object", "content"], nil) + note = note + |> Map.put(:data, data) + + user = User.get_cached_by_ap_id(note.data["actor"]) + + status = StatusView.render("status.json", %{activity: note}) + + assert status.content == "" + end + test "a note activity" do note = insert(:note_activity) user = User.get_cached_by_ap_id(note.data["actor"]) |