tests: add tests for Transmogrifier.maybe_fix_user_object()
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 19 May 2018 08:06:23 +0000 (08:06 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 19 May 2018 08:28:30 +0000 (03:28 -0500)
test/web/activity_pub/transmogrifier_test.exs

index a3408da9db58a95983585a645879d68b6b5fb04d..b02d80cce74af8ba004726576830e9ec0f96b2e3 100644 (file)
@@ -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