From 35bd1977335a2bf73207f22aecbaead6e3112a1c Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 2 Oct 2024 18:39:14 -0400 Subject: Fix nonexisting user will not generate metadata for search engine opt-out --- test/pleroma/web/fallback_test.exs | 2 +- test/pleroma/web/feed/user_controller_test.exs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/web/fallback_test.exs b/test/pleroma/web/fallback_test.exs index ed34d6490..9184cf8f1 100644 --- a/test/pleroma/web/fallback_test.exs +++ b/test/pleroma/web/fallback_test.exs @@ -32,7 +32,7 @@ defmodule Pleroma.Web.FallbackTest do resp = get(conn, "/foo") assert html_response(resp, 200) =~ "a cool title" - refute html_response(resp, 200) =~ "initial-results" + assert html_response(resp, 200) =~ "" end test "GET /*path", %{conn: conn} do diff --git a/test/pleroma/web/feed/user_controller_test.exs b/test/pleroma/web/feed/user_controller_test.exs index 1c17d47b4..0a3aaff5c 100644 --- a/test/pleroma/web/feed/user_controller_test.exs +++ b/test/pleroma/web/feed/user_controller_test.exs @@ -147,6 +147,15 @@ defmodule Pleroma.Web.Feed.UserControllerTest do assert response(conn, 404) end + test "returns noindex meta for missing user", %{conn: conn} do + conn = + conn + |> put_req_header("accept", "text/html") + |> get("/users/nonexisting") + + assert html_response(conn, 200) =~ "" + end + test "returns feed with public and unlisted activities", %{conn: conn} do user = insert(:user) -- cgit v1.2.3