Merge branch 'feature/incoming_ostatus' of ssh.gitgud.io:lambadalambda/pleroma into...
[akkoma] / test / web / ostatus / ostatus_test.exs
index 8ee605494b26ff090743174d044e6b74dc40405e..96f2cb4f382b17666f1c1cbf9f4ee09c81a1b381 100644 (file)
@@ -9,6 +9,18 @@ defmodule Pleroma.Web.OStatusTest do
     assert activity.data["type"] == "Create"
     assert activity.data["object"]["type"] == "Note"
     assert activity.data["published"] == "2017-04-23T14:51:03+00:00"
+    assert activity.data["context"] == "tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b"
+    assert "http://pleroma.example.org:4000/users/lain3" in activity.data["to"]
+  end
+
+  test "handle incoming replies" do
+    incoming = File.read!("test/fixtures/incoming_note_activity_answer.xml")
+    {:ok, activity} = OStatus.handle_incoming(incoming)
+
+    assert activity.data["type"] == "Create"
+    assert activity.data["object"]["type"] == "Note"
+    assert activity.data["object"]["inReplyTo"] == "http://pleroma.example.org:4000/objects/55bce8fc-b423-46b1-af71-3759ab4670bc"
+    assert "http://pleroma.example.org:4000/users/lain5" in activity.data["to"]
   end
 
   describe "new remote user creation" do