logo

pleroma

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

federating_plug_test.exs (784B)


  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.FederatingPlugTest do
  5. use Pleroma.Web.ConnCase
  6. setup do: clear_config([:instance, :federating])
  7. test "returns and halt the conn when federating is disabled" do
  8. Pleroma.Config.put([:instance, :federating], false)
  9. conn =
  10. build_conn()
  11. |> Pleroma.Web.FederatingPlug.call(%{})
  12. assert conn.status == 404
  13. assert conn.halted
  14. end
  15. test "does nothing when federating is enabled" do
  16. Pleroma.Config.put([:instance, :federating], true)
  17. conn =
  18. build_conn()
  19. |> Pleroma.Web.FederatingPlug.call(%{})
  20. refute conn.status
  21. refute conn.halted
  22. end
  23. end