diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-11-10 19:18:53 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-11-10 19:20:14 +0300 |
commit | 485697d96c6a45127af22b9a5f357c3802dba73c (patch) | |
tree | f5a07105ae4c6ec33057a4c8db3b90dac7c44e74 /test | |
parent | db07b538a511b315a3638f3d0b1abfb4877d10c9 (diff) | |
download | pleroma-485697d96c6a45127af22b9a5f357c3802dba73c.tar.gz pleroma-485697d96c6a45127af22b9a5f357c3802dba73c.zip |
config descriptions for custom MRF policies
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/modules/good_mrf.ex | 19 | ||||
-rw-r--r-- | test/pleroma/web/activity_pub/mrf_test.exs | 17 |
2 files changed, 36 insertions, 0 deletions
diff --git a/test/fixtures/modules/good_mrf.ex b/test/fixtures/modules/good_mrf.ex new file mode 100644 index 000000000..39d0f14ec --- /dev/null +++ b/test/fixtures/modules/good_mrf.ex @@ -0,0 +1,19 @@ +defmodule Fixtures.Modules.GoodMRF do + @behaviour Pleroma.Web.ActivityPub.MRF + + @impl true + def filter(a), do: {:ok, a} + + @impl true + def describe, do: %{} + + @impl true + def config_description do + %{ + key: :good_mrf, + related_policy: "Fixtures.Modules.GoodMRF", + label: "Good MRF", + description: "Some description" + } + end +end diff --git a/test/pleroma/web/activity_pub/mrf_test.exs b/test/pleroma/web/activity_pub/mrf_test.exs index e8cdde2e1..17aef2e16 100644 --- a/test/pleroma/web/activity_pub/mrf_test.exs +++ b/test/pleroma/web/activity_pub/mrf_test.exs @@ -87,4 +87,21 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do {:ok, ^expected} = MRF.describe() end end + + test "config_descriptions/0" do + descriptions = MRF.config_descriptions() + + good_mrf = Enum.find(descriptions, fn %{key: key} -> key == :good_mrf end) + + assert good_mrf == %{ + key: :good_mrf, + related_policy: "Fixtures.Modules.GoodMRF", + label: "Good MRF", + description: "Some description", + children: [], + group: :pleroma, + tab: :mrf, + type: :group + } + end end |