diff options
| author | feld <feld@feld.me> | 2020-11-11 13:48:03 +0000 | 
|---|---|---|
| committer | feld <feld@feld.me> | 2020-11-11 13:48:03 +0000 | 
| commit | 3cd7ea693fa820c04257b893725100eccf1cc96c (patch) | |
| tree | e5532c1f049e82c739a13ae56c1307c25301417e /test | |
| parent | 88f6b61a5e31856eb4cee204adf3fc9a6ab78d76 (diff) | |
| parent | f97f24b067b6d0205f093b04aeb08c3d56faa7b4 (diff) | |
| download | pleroma-3cd7ea693fa820c04257b893725100eccf1cc96c.tar.gz pleroma-3cd7ea693fa820c04257b893725100eccf1cc96c.zip | |
Merge branch 'feature/2222-config-descriptions-for-custom-modules' into 'develop'
Config descriptions for custom MRF policies
Closes #2222
See merge request pleroma/pleroma!3128
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 | 
