+ assert json_response_and_validate_schema(conn, 400) == %{"error" => "Account not found"}
+ end
+
+ test "doesn't fail if an admin has no email", %{conn: conn, target_user: target_user} do
+ insert(:user, %{is_admin: true, email: nil})
+
+ assert %{"action_taken" => false, "id" => _} =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/reports", %{"account_id" => target_user.id})
+ |> json_response_and_validate_schema(200)