summaryrefslogtreecommitdiff
path: root/test/web
diff options
context:
space:
mode:
Diffstat (limited to 'test/web')
-rw-r--r--test/web/ostatus/ostatus_test.exs17
-rw-r--r--test/web/websub/websub_controller_test.exs2
2 files changed, 15 insertions, 4 deletions
diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs
index cc0975bb5..1e747c728 100644
--- a/test/web/ostatus/ostatus_test.exs
+++ b/test/web/ostatus/ostatus_test.exs
@@ -1,11 +1,10 @@
defmodule Pleroma.Web.OStatusTest do
use Pleroma.DataCase
alias Pleroma.Web.OStatus
- alias Pleroma.Web.XML
- test "handle incoming notes" do
+ test "handle incoming note - GS, Salmon" do
incoming = File.read!("test/fixtures/incoming_note_activity.xml")
- {:ok, activity} = OStatus.handle_incoming(incoming)
+ {:ok, [activity]} = OStatus.handle_incoming(incoming)
assert activity.data["type"] == "Create"
assert activity.data["object"]["type"] == "Note"
@@ -14,9 +13,19 @@ defmodule Pleroma.Web.OStatusTest do
assert "http://pleroma.example.org:4000/users/lain3" in activity.data["to"]
end
+ test "handle incoming notes - GS, subscription" do
+ incoming = File.read!("test/fixtures/ostatus_incoming_post.xml")
+ {:ok, [activity]} = OStatus.handle_incoming(incoming)
+
+ assert activity.data["type"] == "Create"
+ assert activity.data["object"]["type"] == "Note"
+ assert activity.data["object"]["actor"] == "https://social.heldscal.la/user/23211"
+ assert activity.data["object"]["content"] == "Will it blend?"
+ end
+
test "handle incoming replies" do
incoming = File.read!("test/fixtures/incoming_note_activity_answer.xml")
- {:ok, activity} = OStatus.handle_incoming(incoming)
+ {:ok, [activity]} = OStatus.handle_incoming(incoming)
assert activity.data["type"] == "Create"
assert activity.data["object"]["type"] == "Note"
diff --git a/test/web/websub/websub_controller_test.exs b/test/web/websub/websub_controller_test.exs
index 521bbb9aa..8f68248a4 100644
--- a/test/web/websub/websub_controller_test.exs
+++ b/test/web/websub/websub_controller_test.exs
@@ -41,6 +41,8 @@ defmodule Pleroma.Web.Websub.WebsubControllerTest do
assert response(conn, 200) == "some challenge"
assert websub.state == "accepted"
+
+ # TODO valid_until
end
test "handles incoming feed updates", %{conn: conn} do