summaryrefslogtreecommitdiff
path: root/test/web/plugs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2019-07-09 15:35:28 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2019-07-09 15:35:28 +0000
commit95c085174dc523f2898f02120d7ff0b120930d91 (patch)
tree101ab8c43a0886b76a574478624058e2c0a29704 /test/web/plugs
parent376a55c97fcf178abec3091db830215642bf23c1 (diff)
parentabe2e8881f946aafc2012edd43373c22837387af (diff)
downloadpleroma-95c085174dc523f2898f02120d7ff0b120930d91.tar.gz
pleroma-95c085174dc523f2898f02120d7ff0b120930d91.zip
Merge branch 'test-speedup' into 'develop'
Testing: Don't federate in testing. See merge request pleroma/pleroma!1391
Diffstat (limited to 'test/web/plugs')
-rw-r--r--test/web/plugs/federating_plug_test.exs13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/web/plugs/federating_plug_test.exs b/test/web/plugs/federating_plug_test.exs
index 530562325..c01e01124 100644
--- a/test/web/plugs/federating_plug_test.exs
+++ b/test/web/plugs/federating_plug_test.exs
@@ -5,6 +5,15 @@
defmodule Pleroma.Web.FederatingPlugTest do
use Pleroma.Web.ConnCase
+ setup_all do
+ config_path = [:instance, :federating]
+ initial_setting = Pleroma.Config.get(config_path)
+
+ on_exit(fn -> Pleroma.Config.put(config_path, initial_setting) end)
+
+ :ok
+ end
+
test "returns and halt the conn when federating is disabled" do
Pleroma.Config.put([:instance, :federating], false)
@@ -14,11 +23,11 @@ defmodule Pleroma.Web.FederatingPlugTest do
assert conn.status == 404
assert conn.halted
-
- Pleroma.Config.put([:instance, :federating], true)
end
test "does nothing when federating is enabled" do
+ Pleroma.Config.put([:instance, :federating], true)
+
conn =
build_conn()
|> Pleroma.Web.FederatingPlug.call(%{})