|
|
@ -10,13 +10,12 @@ defmodule Pleroma.Web.ObjectValidators.Types.ObjectIDTest do
|
|
|
|
|
|
|
|
|
|
|
|
@non_uris [
|
|
|
|
@non_uris [
|
|
|
|
"https://",
|
|
|
|
"https://",
|
|
|
|
"rin"
|
|
|
|
"rin",
|
|
|
|
|
|
|
|
1,
|
|
|
|
|
|
|
|
:x,
|
|
|
|
|
|
|
|
%{"1" => 2}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
test "it rejects integers" do
|
|
|
|
|
|
|
|
assert :error == ObjectID.cast(1)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test "it accepts http uris" do
|
|
|
|
test "it accepts http uris" do
|
|
|
|
Enum.each(@uris, fn uri ->
|
|
|
|
Enum.each(@uris, fn uri ->
|
|
|
|
assert {:ok, uri} == ObjectID.cast(uri)
|
|
|
|
assert {:ok, uri} == ObjectID.cast(uri)
|
|
|
|