Add delete activity representer.
[akkoma] / test / web / ostatus / ostatus_test.exs
index 44d687d8e9a1a1d196548edae715447c9d9ddd04..ee2b79ffa6d8566783689fbf49255a7007fe4f81 100644 (file)
@@ -182,6 +182,13 @@ defmodule Pleroma.Web.OStatusTest do
     refute favorited_activity.local
   end
 
+  test "handle conversation references" do
+    incoming = File.read!("test/fixtures/mastodon_conversation.xml")
+    {:ok, [activity]} = OStatus.handle_incoming(incoming)
+
+    assert activity.data["context"] == "tag:mastodon.social,2017-08-28:objectId=7876885:objectType=Conversation"
+  end
+
   test "handle incoming favorites with locally available object - GS, websub" do
     note_activity = insert(:note_activity)
 
@@ -346,4 +353,11 @@ defmodule Pleroma.Web.OStatusTest do
 
     assert {:ok, %User{}} = OStatus.insert_or_update_user(data)
   end
+
+  test "it doesn't add nil in the do field" do
+    incoming = File.read!("test/fixtures/nil_mention_entry.xml")
+    {:ok, [activity]} = OStatus.handle_incoming(incoming)
+
+    assert activity.data["to"] == ["http://localhost:4001/users/atarifrosch@social.stopwatchingus-heidelberg.de/followers", "https://www.w3.org/ns/activitystreams#Public"]
+  end
 end