diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-04-28 09:32:43 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-04-28 09:32:43 +0300 |
commit | ea5142b94bcd1a02571776440dc828dd08a2c3d6 (patch) | |
tree | b096e8dc1390634d4ec4837a43ba77240b882c85 /test/web | |
parent | c5c09fc61b7b6e591e9de23028e5caea8f26b996 (diff) | |
download | pleroma-ea5142b94bcd1a02571776440dc828dd08a2c3d6.tar.gz pleroma-ea5142b94bcd1a02571776440dc828dd08a2c3d6.zip |
convert markdown content to html
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index de9663fa9..0404aae6a 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -1221,11 +1221,20 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do :error = Transmogrifier.handle_incoming(data) end - test "it remaps mediaType of object" do - {:ok, object} = - Fetcher.fetch_object_from_id( - "https://bittube.video/videos/watch/2aad7dfb-5c75-4ee6-a9ed-08436af0558b" - ) + test "it converts content of object to html" do + object_id = "https://peertube.social/videos/watch/278d2b7c-0f38-4aaa-afe6-9ecc0c4a34fe" + + {:ok, %{"content" => content_markdown}} = + Fetcher.fetch_and_contain_remote_object_from_id(object_id) + + {:ok, %Pleroma.Object{data: %{"content" => content}} = object} = + Fetcher.fetch_object_from_id(object_id) + + assert content_markdown == + "Support this and our other Michigan!/usr/group videos and meetings. Learn more at http://mug.org/membership\n\nTwenty Years in Jail: FreeBSD's Jails, Then and Now\n\nJails started as a limited virtualization system, but over the last two years they've..." + + assert content == + "<p>Support this and our other Michigan!/usr/group videos and meetings. Learn more at <a href=\"http://mug.org/membership\">http://mug.org/membership</a></p><p>Twenty Years in Jail: FreeBSD’s Jails, Then and Now</p><p>Jails started as a limited virtualization system, but over the last two years they’ve…</p>" assert object.data["mediaType"] == "text/html" end |