Merge branch 'fix/1601-add-new-meta-tag' into 'develop'
[akkoma] / test / web / metadata / metadata_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.MetadataTest do
6 use Pleroma.DataCase, async: true
7
8 import Pleroma.Factory
9
10 describe "restrict indexing remote users" do
11 test "for remote user" do
12 user = insert(:user, local: false)
13
14 assert Pleroma.Web.Metadata.build_tags(%{user: user}) =~
15 "<meta content=\"noindex, noarchive\" name=\"robots\">"
16 end
17
18 test "for local user" do
19 user = insert(:user)
20
21 refute Pleroma.Web.Metadata.build_tags(%{user: user}) =~
22 "<meta content=\"noindex, noarchive\" name=\"robots\">"
23 end
24 end
25 end