Merge branch 'feature/1952-read-muted-notifications' into 'develop'
[akkoma] / test / web / activity_pub / transmogrifier / question_handling_test.exs
index 12516c4abc5394cf9224f57ec702cebc3331bd29..c82361828883ef0b17fb7ede4f46a6194b52ec7d 100644 (file)
@@ -24,6 +24,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do
 
     object = Object.normalize(activity, false)
 
+    assert object.data["url"] == "https://mastodon.sdf.org/@rinpatch/102070944809637304"
+
     assert object.data["closed"] == "2019-05-11T09:03:36Z"
 
     assert object.data["context"] == activity.data["context"]
@@ -111,4 +113,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