summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLain Soykaf <lain@lain.com>2022-12-15 17:46:20 -0500
committerLain Soykaf <lain@lain.com>2022-12-15 17:46:20 -0500
commit9838790a7d14e72449af3ae53daf3df30fd1aba0 (patch)
tree80d90f2254aaf1910f3ffb7ff1358e2066f77357 /test
parent63d00f8123ddc5a8d9917e48216775f98ceac713 (diff)
AttachmentValidator: Actually require url
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
index 9a17e277e..77f2044e9 100644
--- a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
+++ b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
@@ -11,6 +11,19 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do
import Pleroma.Factory
describe "attachments" do
+ test "fails without url" do
+ attachment = %{
+ "mediaType" => "",
+ "name" => "",
+ "summary" => "298p3RG7j27tfsZ9RQ.jpg",
+ "type" => "Document"
+ }
+
+ assert {:error, _cng} =
+ AttachmentValidator.cast_and_validate(attachment)
+ |> Ecto.Changeset.apply_action(:insert)
+ end
+
test "works with honkerific attachments" do
attachment = %{
"mediaType" => "",