You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
790 B
32 lines
790 B
6 years ago
|
# Pleroma: A lightweight social networking server
|
||
5 years ago
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||
6 years ago
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
||
4 years ago
|
defmodule Pleroma.Web.Plugs.FederatingPlugTest do
|
||
6 years ago
|
use Pleroma.Web.ConnCase
|
||
5 years ago
|
|
||
5 years ago
|
setup do: clear_config([:instance, :federating])
|
||
5 years ago
|
|
||
6 years ago
|
test "returns and halt the conn when federating is disabled" do
|
||
5 years ago
|
Pleroma.Config.put([:instance, :federating], false)
|
||
6 years ago
|
|
||
|
conn =
|
||
|
build_conn()
|
||
|
|> Pleroma.Web.FederatingPlug.call(%{})
|
||
|
|
||
|
assert conn.status == 404
|
||
|
assert conn.halted
|
||
|
end
|
||
|
|
||
|
test "does nothing when federating is enabled" do
|
||
5 years ago
|
Pleroma.Config.put([:instance, :federating], true)
|
||
|
|
||
6 years ago
|
conn =
|
||
|
build_conn()
|
||
|
|> Pleroma.Web.FederatingPlug.call(%{})
|
||
|
|
||
|
refute conn.status
|
||
|
refute conn.halted
|
||
|
end
|
||
|
end
|