diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-04-29 21:13:21 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-04-29 21:13:21 +0200 |
commit | a16da387d251edc4d1bae949146c807d217cee1f (patch) | |
tree | 2b0982989bc12b94675a9806aded0174a9702e51 /test/web | |
parent | 20015b4b67cf0dfab6bdb658c9eb0e1ae04febdc (diff) | |
download | pleroma-a16da387d251edc4d1bae949146c807d217cee1f.tar.gz pleroma-a16da387d251edc4d1bae949146c807d217cee1f.zip |
Handle full incoming feeds.
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/ostatus/ostatus_test.exs | 17 | ||||
-rw-r--r-- | test/web/websub/websub_controller_test.exs | 2 |
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 |