Change user.discoverable field to user.is_discoverable
[akkoma] / test / web / activity_pub / mrf / mrf_test.exs
index 19e1729394e72e9fa2a2a49ed30d9c9a2f04d571..e8cdde2e1f82a91c7f7bb6b8ed053b838da44f86 100644 (file)
@@ -1,5 +1,10 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Web.ActivityPub.MRFTest do
   use ExUnit.Case, async: true
+  use Pleroma.Tests.Helpers
   alias Pleroma.Web.ActivityPub.MRF
 
   test "subdomains_regex/1" do
@@ -60,6 +65,8 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do
 
   describe "describe/0" do
     test "it works as expected with noop policy" do
+      clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.NoOpPolicy])
+
       expected = %{
         mrf_policies: ["NoOpPolicy"],
         exclusions: false
@@ -69,8 +76,7 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do
     end
 
     test "it works as expected with mock policy" do
-      config = Pleroma.Config.get([:instance, :rewrite_policy])
-      Pleroma.Config.put([:instance, :rewrite_policy], [MRFModuleMock])
+      clear_config([:mrf, :policies], [MRFModuleMock])
 
       expected = %{
         mrf_policies: ["MRFModuleMock"],
@@ -79,8 +85,6 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do
       }
 
       {:ok, ^expected} = MRF.describe()
-
-      Pleroma.Config.put([:instance, :rewrite_policy], config)
     end
   end
 end