summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2024-03-07 14:05:45 +0100
committermarcin mikołajczak <git@mkljczk.pl>2024-03-07 14:05:45 +0100
commita6e066a77d5ce65b034cd62775614d5902d29d85 (patch)
treead51bd94063d9e8501e41cd25183769daff86f6c /test
parent05cb931e4d5e312477cc6c4cf80ab10180b84fd1 (diff)
downloadpleroma-a6e066a77d5ce65b034cd62775614d5902d29d85.tar.gz
pleroma-a6e066a77d5ce65b034cd62775614d5902d29d85.zip
Fix adding language to json ld header, add transmogrifier test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/transmogrifier_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs
index a49e459a6..8fbcf15f1 100644
--- a/test/pleroma/web/activity_pub/transmogrifier_test.exs
+++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs
@@ -384,6 +384,24 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
assert modified["object"]["quoteUrl"] == quote_id
assert modified["object"]["quoteUri"] == quote_id
end
+
+ test "it adds language of the object to its json-ld context" do
+ user = insert(:user)
+
+ {:ok, activity} = CommonAPI.post(user, %{status: "Cześć", language: "pl"})
+ {:ok, modified} = Transmogrifier.prepare_outgoing(activity.object.data)
+
+ assert [_, _, %{"@language" => "pl"}] = modified["@context"]
+ end
+
+ test "it adds language of the object to Create activity json-ld context" do
+ user = insert(:user)
+
+ {:ok, activity} = CommonAPI.post(user, %{status: "Cześć", language: "pl"})
+ {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
+
+ assert [_, _, %{"@language" => "pl"}] = modified["@context"]
+ end
end
describe "actor rewriting" do