From cf9ecddbeea9efc00c406bfb1104841de2be8f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 19 Aug 2023 20:33:42 +0200 Subject: [PATCH] Remove test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../activity_pub/object_validators/map_of_string.ex | 2 +- .../activity_pub/object_validators/common_fixes.ex | 2 +- .../object_validators/map_of_string_test.exs | 5 +++-- .../pleroma/web/activity_pub/transmogrifier_test.exs | 12 ------------ 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/pleroma/ecto_type/activity_pub/object_validators/map_of_string.ex b/lib/pleroma/ecto_type/activity_pub/object_validators/map_of_string.ex index e86275f928..96b7f2da62 100644 --- a/lib/pleroma/ecto_type/activity_pub/object_validators/map_of_string.ex +++ b/lib/pleroma/ecto_type/activity_pub/object_validators/map_of_string.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors +# Copyright © 2017-2023 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.MapOfString do diff --git a/lib/pleroma/web/activity_pub/object_validators/common_fixes.ex b/lib/pleroma/web/activity_pub/object_validators/common_fixes.ex index 0bcac667a2..f331378a30 100644 --- a/lib/pleroma/web/activity_pub/object_validators/common_fixes.ex +++ b/lib/pleroma/web/activity_pub/object_validators/common_fixes.ex @@ -177,7 +177,7 @@ defp get_language_from_content(%{"content" => content}) do defp get_language_from_content(_), do: nil def maybe_add_content_map(%{"language" => language, "content" => content} = object) - when not_empty_string(language) do + when not_empty_string(language) do Map.put(object, "contentMap", Map.put(%{}, language, content)) end 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 index 4ee179dc8e..941199ce81 100644 --- 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 @@ -1,11 +1,12 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors +# Copyright © 2017-2023 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.MapOfStringTest do - alias Pleroma.EctoType.ActivityPub.ObjectValidators.MapOfString use Pleroma.DataCase, async: true + alias Pleroma.EctoType.ActivityPub.ObjectValidators.MapOfString + test "it validates" do data = %{ "en-US" => "mew mew", diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 1244974649..264f0ccdbb 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -376,18 +376,6 @@ test "it prepares a quote post" do end end - test "it adds contentMap if language is specified" do - user = insert(:user) - - {:ok, activity} = CommonAPI.post(user, %{status: "тест", language: "uk"}) - - {:ok, prepared} = Transmogrifier.prepare_outgoing(activity.data) - - assert prepared["object"]["contentMap"] == %{ - "uk" => "тест" - } - end - describe "actor rewriting" do test "it fixes the actor URL property to be a proper URI" do data = %{