logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

restrict_indexing_test.exs (1033B)


  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. defmodule Pleroma.Web.Metadata.Providers.RestrictIndexingTest do
  5. use ExUnit.Case, async: true
  6. describe "build_tags/1" do
  7. test "for remote user" do
  8. assert Pleroma.Web.Metadata.Providers.RestrictIndexing.build_tags(%{
  9. user: %Pleroma.User{local: false}
  10. }) == [{:meta, [name: "robots", content: "noindex, noarchive"], []}]
  11. end
  12. test "for local user" do
  13. assert Pleroma.Web.Metadata.Providers.RestrictIndexing.build_tags(%{
  14. user: %Pleroma.User{local: true, discoverable: true}
  15. }) == []
  16. end
  17. test "for local user when discoverable is false" do
  18. assert Pleroma.Web.Metadata.Providers.RestrictIndexing.build_tags(%{
  19. user: %Pleroma.User{local: true, discoverable: false}
  20. }) == [{:meta, [name: "robots", content: "noindex, noarchive"], []}]
  21. end
  22. end
  23. end