Merge branch 'bare_uri_test' into 'develop'
Activate test for object validator that has not been running See merge request pleroma/pleroma!3968
This commit is contained in:
commit
0f56304f09
|
@ -9,17 +9,17 @@ defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.BareUriTest do
|
||||||
|
|
||||||
test "diaspora://" do
|
test "diaspora://" do
|
||||||
text = "diaspora://alice@fediverse.example/post/deadbeefdeadbeefdeadbeefdeadbeef"
|
text = "diaspora://alice@fediverse.example/post/deadbeefdeadbeefdeadbeefdeadbeef"
|
||||||
assert {:ok, text} = BareUri.cast(text)
|
assert {:ok, ^text} = BareUri.cast(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "nostr:" do
|
test "nostr:" do
|
||||||
text = "nostr:note1gwdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
|
text = "nostr:note1gwdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
|
||||||
assert {:ok, text} = BareUri.cast(text)
|
assert {:ok, ^text} = BareUri.cast(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "errors for non-URIs" do
|
test "errors for non-URIs" do
|
||||||
assert :error == SafeText.cast(1)
|
assert :error == BareUri.cast(1)
|
||||||
assert :error == SafeText.cast("foo")
|
assert :error == BareUri.cast("foo")
|
||||||
assert :error == SafeText.cast("foo bar")
|
assert :error == BareUri.cast("foo bar")
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue