summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/ecto_type/activity_pub/object_validators/map_of_string_test.exs56
1 files changed, 0 insertions, 56 deletions
diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/map_of_string_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/map_of_string_test.exs
deleted file mode 100644
index 941199ce8..000000000
--- a/test/pleroma/ecto_type/activity_pub/object_validators/map_of_string_test.exs
+++ /dev/null
@@ -1,56 +0,0 @@
-# Pleroma: A lightweight social networking server
-# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
-# SPDX-License-Identifier: AGPL-3.0-only
-
-defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.MapOfStringTest do
- use Pleroma.DataCase, async: true
-
- alias Pleroma.EctoType.ActivityPub.ObjectValidators.MapOfString
-
- test "it validates" do
- data = %{
- "en-US" => "mew mew",
- "en-GB" => "meow meow"
- }
-
- assert {:ok, ^data} = MapOfString.cast(data)
- end
-
- test "it validates empty strings" do
- data = %{
- "en-US" => "mew mew",
- "en-GB" => ""
- }
-
- assert {:ok, ^data} = MapOfString.cast(data)
- end
-
- test "it ignores non-strings within the map" do
- data = %{
- "en-US" => "mew mew",
- "en-GB" => 123
- }
-
- assert {:ok, validated_data} = MapOfString.cast(data)
-
- assert validated_data == %{"en-US" => "mew mew"}
- end
-
- test "it ignores bad locale codes" do
- data = %{
- "en-US" => "mew mew",
- "en_GB" => "meow meow",
- "en<<#@!$#!@%!GB" => "meow meow"
- }
-
- assert {:ok, validated_data} = MapOfString.cast(data)
-
- assert validated_data == %{"en-US" => "mew mew"}
- end
-
- test "it complains with non-map data" do
- assert :error = MapOfString.cast("mew")
- assert :error = MapOfString.cast(["mew"])
- assert :error = MapOfString.cast([%{"en-US" => "mew"}])
- end
-end