Apply, suggestions, use strings for actual Mastodon API compatibility
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
5c383ada8a
commit
b354d70e85
11 changed files with 38 additions and 15 deletions
|
|
@ -27,6 +27,10 @@ defmodule Pleroma.Web.AdminAPI.RuleControllerTest do
|
|||
%{id: id2} = Rule.create(%{text: "Second rule", priority: 2})
|
||||
%{id: id3} = Rule.create(%{text: "Third rule", priority: 1})
|
||||
|
||||
id1 = to_string(id1)
|
||||
id2 = to_string(id2)
|
||||
id3 = to_string(id3)
|
||||
|
||||
response =
|
||||
conn
|
||||
|> get("/api/pleroma/admin/rules")
|
||||
|
|
|
|||
|
|
@ -65,6 +65,23 @@ defmodule Pleroma.Web.MastodonAPI.ReportControllerTest do
|
|||
assert %Activity{data: %{"rules" => [^rule_id]}} = Activity.get_report(id)
|
||||
end
|
||||
|
||||
test "rules field is empty if provided wrong rule id", %{
|
||||
conn: conn,
|
||||
target_user: target_user
|
||||
} do
|
||||
assert %{"id" => id} =
|
||||
conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/v1/reports", %{
|
||||
"account_id" => target_user.id,
|
||||
"forward" => "false",
|
||||
"rule_ids" => ["-1"]
|
||||
})
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
assert %Activity{data: %{"rules" => []}} = Activity.get_report(id)
|
||||
end
|
||||
|
||||
test "account_id is required", %{
|
||||
conn: conn,
|
||||
activity: activity
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue