diff options
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 | 16 | 
2 files changed, 35 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..44a9cf086 100644 --- a/test/pleroma/web/activity_pub/mrf_test.exs +++ b/test/pleroma/web/activity_pub/mrf_test.exs @@ -87,4 +87,20 @@ 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", +             group: :pleroma, +             tab: :mrf, +             type: :group +           } +  end  end | 
