From 19c96c8a19aece5419bc0be5ea3e2945887828b7 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 19 May 2018 08:06:23 +0000 Subject: [PATCH] tests: add tests for Transmogrifier.maybe_fix_user_object() --- test/web/activity_pub/transmogrifier_test.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index a3408da9d..b02d80cce 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -420,4 +420,15 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do assert Repo.get(WebsubClientSubscription, ws2.id) end end + + describe "actor rewriting" do + test "it fixes the actor URL property to be a proper URI" do + data = %{ + "url" => %{"href" => "http://example.com"} + } + + rewritten = Transmogrifier.maybe_fix_user_object(data) + assert rewritten["url"] == "http://example.com" + end + end end -- 2.45.2