Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/delete-validator

This commit is contained in:
lain 2020-05-03 12:55:29 +02:00
commit 6fb96f64c1
156 changed files with 1597 additions and 747 deletions

View file

@ -1357,9 +1357,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
{:ok, %{id: report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I feel offended",
"status_ids" => [activity.id]
account_id: target_user.id,
comment: "I feel offended",
status_ids: [activity.id]
})
response =
@ -1384,16 +1384,16 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
{:ok, %{id: report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I feel offended",
"status_ids" => [activity.id]
account_id: target_user.id,
comment: "I feel offended",
status_ids: [activity.id]
})
{:ok, %{id: second_report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I feel very offended",
"status_ids" => [activity.id]
account_id: target_user.id,
comment: "I feel very offended",
status_ids: [activity.id]
})
%{
@ -1533,9 +1533,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
{:ok, %{id: report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I feel offended",
"status_ids" => [activity.id]
account_id: target_user.id,
comment: "I feel offended",
status_ids: [activity.id]
})
response =
@ -1557,15 +1557,15 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
{:ok, %{id: first_report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I feel offended",
"status_ids" => [activity.id]
account_id: target_user.id,
comment: "I feel offended",
status_ids: [activity.id]
})
{:ok, %{id: second_report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I don't like this user"
account_id: target_user.id,
comment: "I don't like this user"
})
CommonAPI.update_report_state(second_report_id, "closed")
@ -3441,9 +3441,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
{:ok, %{id: report_id}} =
CommonAPI.report(reporter, %{
"account_id" => target_user.id,
"comment" => "I feel offended",
"status_ids" => [activity.id]
account_id: target_user.id,
comment: "I feel offended",
status_ids: [activity.id]
})
post(conn, "/api/pleroma/admin/reports/#{report_id}/notes", %{

View file

@ -15,7 +15,7 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
user = insert(:user)
other_user = insert(:user)
{:ok, activity} = CommonAPI.report(user, %{"account_id" => other_user.id})
{:ok, activity} = CommonAPI.report(user, %{account_id: other_user.id})
expected = %{
content: nil,
@ -48,7 +48,7 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "toot"})
{:ok, report_activity} =
CommonAPI.report(user, %{"account_id" => other_user.id, "status_ids" => [activity.id]})
CommonAPI.report(user, %{account_id: other_user.id, status_ids: [activity.id]})
other_user = Pleroma.User.get_by_id(other_user.id)
@ -81,7 +81,7 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
user = insert(:user)
other_user = insert(:user)
{:ok, activity} = CommonAPI.report(user, %{"account_id" => other_user.id})
{:ok, activity} = CommonAPI.report(user, %{account_id: other_user.id})
{:ok, activity} = CommonAPI.update_report_state(activity.id, "closed")
assert %{state: "closed"} =
@ -94,8 +94,8 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
{:ok, activity} =
CommonAPI.report(user, %{
"account_id" => other_user.id,
"comment" => "posts are too good for this instance"
account_id: other_user.id,
comment: "posts are too good for this instance"
})
assert %{content: "posts are too good for this instance"} =
@ -108,8 +108,8 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
{:ok, activity} =
CommonAPI.report(user, %{
"account_id" => other_user.id,
"comment" => ""
account_id: other_user.id,
comment: ""
})
data = Map.put(activity.data, "content", "<script> alert('hecked :D:D:D:D:D:D:D') </script>")
@ -125,8 +125,8 @@ defmodule Pleroma.Web.AdminAPI.ReportViewTest do
{:ok, activity} =
CommonAPI.report(user, %{
"account_id" => other_user.id,
"comment" => ""
account_id: other_user.id,
comment: ""
})
Pleroma.User.delete(other_user)