Fix report content stopping to be nullable

This commit is contained in:
rinpatch 2019-06-16 12:57:58 +03:00
commit bf6aa6f1a8
2 changed files with 11 additions and 4 deletions

View file

@ -17,7 +17,7 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
{:ok, activity} = CommonAPI.report(user, %{"account_id" => other_user.id})
expected = %{
content: "",
content: nil,
actor: AccountView.render("account.json", %{user: user}),
account: AccountView.render("account.json", %{user: other_user}),
statuses: [],
@ -41,7 +41,7 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
CommonAPI.report(user, %{"account_id" => other_user.id, "status_ids" => [activity.id]})
expected = %{
content: "",
content: nil,
actor: AccountView.render("account.json", %{user: user}),
account: AccountView.render("account.json", %{user: other_user}),
statuses: [StatusView.render("status.json", %{activity: activity})],
@ -92,7 +92,7 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
data = Map.put(activity.data, "content", "<script> alert('hecked :D:D:D:D:D:D:D') </script>")
activity = Map.put(activity, :data, data)
refute %{content: "<script> alert('hecked :D:D:D:D:D:D:D') </script>"} ==
refute "<script> alert('hecked :D:D:D:D:D:D:D') </script>" ==
ReportView.render("show.json", %{report: activity})[:content]
end
end