1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Metadata.Providers.RestrictIndexingTest do
6 use ExUnit.Case, async: true
8 describe "build_tags/1" do
9 test "for remote user" do
10 assert Pleroma.Web.Metadata.Providers.RestrictIndexing.build_tags(%{
11 user: %Pleroma.User{local: false}
12 }) == [{:meta, [name: "robots", content: "noindex, noarchive"], []}]
15 test "for local user" do
16 assert Pleroma.Web.Metadata.Providers.RestrictIndexing.build_tags(%{
17 user: %Pleroma.User{local: true, is_discoverable: true}
21 test "for local user when `is_discoverable` is false" do
22 assert Pleroma.Web.Metadata.Providers.RestrictIndexing.build_tags(%{
23 user: %Pleroma.User{local: true, is_discoverable: false}
24 }) == [{:meta, [name: "robots", content: "noindex, noarchive"], []}]