summaryrefslogtreecommitdiff
path: root/test/web/ostatus/ostatus_controller_test.exs
diff options
context:
space:
mode:
authorTristan Mahé <gled@remote-shell.net>2018-07-19 17:44:18 -0700
committerTristan Mahé <gled@remote-shell.net>2018-07-19 17:44:18 -0700
commitbc2668bb63aee2c42cdea48782ba5ef291c17b45 (patch)
tree838d334208c4dadf23b974181c0ad4c17b199f8c /test/web/ostatus/ostatus_controller_test.exs
parent5469fb9561bb886deb8434e545dfb711eb20f341 (diff)
parent41b0ecef959df0a1cda71e56e256cacebe48d56f (diff)
downloadpleroma-bc2668bb63aee2c42cdea48782ba5ef291c17b45.tar.gz
pleroma-bc2668bb63aee2c42cdea48782ba5ef291c17b45.zip
Merge remote-tracking branch 'upstream/develop' into feature/filter_exif
Diffstat (limited to 'test/web/ostatus/ostatus_controller_test.exs')
-rw-r--r--test/web/ostatus/ostatus_controller_test.exs25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs
index d5adf3bf3..c23b175e8 100644
--- a/test/web/ostatus/ostatus_controller_test.exs
+++ b/test/web/ostatus/ostatus_controller_test.exs
@@ -155,6 +155,31 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do
assert response(conn, 200)
end
+ test "gets a notice in AS2 format", %{conn: conn} do
+ note_activity = insert(:note_activity)
+ url = "/notice/#{note_activity.id}"
+
+ conn =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(url)
+
+ assert json_response(conn, 200)
+ end
+
+ test "gets an activity in AS2 format", %{conn: conn} do
+ note_activity = insert(:note_activity)
+ [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["id"]))
+ url = "/activities/#{uuid}"
+
+ conn =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(url)
+
+ assert json_response(conn, 200)
+ end
+
test "404s a private notice", %{conn: conn} do
note_activity = insert(:direct_note_activity)
url = "/notice/#{note_activity.id}"