diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-19 15:53:02 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-19 15:53:02 +0200 |
commit | 03b7b2fa24127847a764403f5374d5c8f36b7c50 (patch) | |
tree | cd456ef8d4c17bcd3f72cd99f04f8a4ae31a72f4 /test | |
parent | f972966385b51c149cf1fda0a73c835a1a10604e (diff) | |
download | pleroma-03b7b2fa24127847a764403f5374d5c8f36b7c50.tar.gz |
Also show activities in OStatus.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/ostatus/ostatus_controller_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs index 8b7ca4d89..77bc202fe 100644 --- a/test/web/ostatus/ostatus_controller_test.exs +++ b/test/web/ostatus/ostatus_controller_test.exs @@ -2,6 +2,7 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do use Pleroma.Web.ConnCase import Pleroma.Factory alias Pleroma.User + alias Pleroma.Web.OStatus.ActivityRepresenter test "gets a feed", %{conn: conn} do note_activity = insert(:note_activity) @@ -15,12 +16,29 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do test "gets an object", %{conn: conn} do note_activity = insert(:note_activity) + user = User.get_by_ap_id(note_activity.data["actor"]) [_, uuid] = hd Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"]) url = "/objects/#{uuid}" conn = conn |> get(url) + expected = ActivityRepresenter.to_simple_form(note_activity, user, true) + |> ActivityRepresenter.wrap_with_entry + |> :xmerl.export_simple(:xmerl_xml) + |> to_string + + assert response(conn, 200) == expected + end + + test "gets an activity", %{conn: conn} do + note_activity = insert(:note_activity) + [_, uuid] = hd Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["id"]) + url = "/activities/#{uuid}" + + conn = conn + |> get(url) + assert response(conn, 200) end end |