diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2023-09-07 15:12:15 +0200 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2023-09-07 15:12:15 +0200 |
commit | c5ed684273fa329bc955c59dbc7beed9804fb0f3 (patch) | |
tree | ba8f6e6bdacf4132ccf540784ef293ddb4beef98 /test | |
parent | b52d189fcca13088531002ef0bdc0dc5e5df6569 (diff) | |
download | pleroma-c5ed684273fa329bc955c59dbc7beed9804fb0f3.tar.gz pleroma-c5ed684273fa329bc955c59dbc7beed9804fb0f3.zip |
Rename MapOfString to ContentLanguageMap
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/ecto_type/activity_pub/object_validators/map_of_string_test.exs | 56 |
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 |