Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / test / web / activity_pub / object_validators / types / object_id_test.exs
index f4c5ed1dc0c720148b7f96e83e7cf0a883ba76c5..e0ab7637944e522638ed5eb5a10b7906db7d69c2 100644 (file)
@@ -1,5 +1,9 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Web.ObjectValidators.Types.ObjectIDTest do
-  alias Pleroma.Web.ActivityPub.ObjectValidators.Types.ObjectID
+  alias Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectID
   use Pleroma.DataCase
 
   @uris [
@@ -10,13 +14,12 @@ defmodule Pleroma.Web.ObjectValidators.Types.ObjectIDTest do
 
   @non_uris [
     "https://",
-    "rin"
+    "rin",
+    1,
+    :x,
+    %{"1" => 2}
   ]
 
-  test "it rejects integers" do
-    assert :error == ObjectID.cast(1)
-  end
-
   test "it accepts http uris" do
     Enum.each(@uris, fn uri ->
       assert {:ok, uri} == ObjectID.cast(uri)