aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-08-04 14:23:35 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-08-04 14:29:16 +0200
commit0f088d8ce35150d7baa0591a25c831fce0181239 (patch)
tree54aa858afea74eba9f8e397ed7c599acab88bb49 /test
parentac2598307d15bd833310f6c5cfadc218b7d80480 (diff)
downloadpleroma-0f088d8ce35150d7baa0591a25c831fce0181239.tar.gz
question_validator: Allow content to be an empty-string (blank)
Diffstat (limited to 'test')
-rw-r--r--test/web/activity_pub/transmogrifier/question_handling_test.exs9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier/question_handling_test.exs b/test/web/activity_pub/transmogrifier/question_handling_test.exs
index 12516c4ab..9fb965d7f 100644
--- a/test/web/activity_pub/transmogrifier/question_handling_test.exs
+++ b/test/web/activity_pub/transmogrifier/question_handling_test.exs
@@ -111,4 +111,13 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do
assert {:error, {:validate_object, {:error, _}}} = Transmogrifier.handle_incoming(data)
end
+
+ test "accepts a Question with no content" do
+ data =
+ File.read!("test/fixtures/mastodon-question-activity.json")
+ |> Poison.decode!()
+ |> Kernel.put_in(["object", "content"], "")
+
+ assert {:ok, %Activity{local: false}} = Transmogrifier.handle_incoming(data)
+ end
end