summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/views
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2018-12-01 18:12:27 +0300
committerrinpatch <rinpatch@sdf.org>2018-12-01 18:12:27 +0300
commitfe2759bc9f2dad044b49f4954693ac09f9368041 (patch)
tree59dd9c5026f433d976defa303de0d6782d435d1e /test/web/activity_pub/views
parentba6e3eba33f16bdd2fede086d5fb5c86201cb57b (diff)
parent8c3ff06e35e11a40cf4eb35a41a2019b7496e62c (diff)
downloadpleroma-fe2759bc9f2dad044b49f4954693ac09f9368041.tar.gz
pleroma-fe2759bc9f2dad044b49f4954693ac09f9368041.zip
Attempt to resolve merge conflict
Diffstat (limited to 'test/web/activity_pub/views')
-rw-r--r--test/web/activity_pub/views/object_view_test.exs41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/web/activity_pub/views/object_view_test.exs b/test/web/activity_pub/views/object_view_test.exs
index 6a1311be7..d144a77fc 100644
--- a/test/web/activity_pub/views/object_view_test.exs
+++ b/test/web/activity_pub/views/object_view_test.exs
@@ -2,6 +2,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
use Pleroma.DataCase
import Pleroma.Factory
+ alias Pleroma.Web.CommonAPI
alias Pleroma.Web.ActivityPub.ObjectView
test "renders a note object" do
@@ -13,5 +14,45 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
assert result["to"] == note.data["to"]
assert result["content"] == note.data["content"]
assert result["type"] == "Note"
+ assert result["@context"]
+ end
+
+ test "renders a note activity" do
+ note = insert(:note_activity)
+
+ result = ObjectView.render("object.json", %{object: note})
+
+ assert result["id"] == note.data["id"]
+ assert result["to"] == note.data["to"]
+ assert result["object"]["type"] == "Note"
+ assert result["object"]["content"] == note.data["object"]["content"]
+ assert result["type"] == "Create"
+ assert result["@context"]
+ end
+
+ test "renders a like activity" do
+ note = insert(:note_activity)
+ user = insert(:user)
+
+ {:ok, like_activity, _} = CommonAPI.favorite(note.id, user)
+
+ result = ObjectView.render("object.json", %{object: like_activity})
+
+ assert result["id"] == like_activity.data["id"]
+ assert result["object"] == note.data["object"]["id"]
+ assert result["type"] == "Like"
+ end
+
+ test "renders an announce activity" do
+ note = insert(:note_activity)
+ user = insert(:user)
+
+ {:ok, announce_activity, _} = CommonAPI.repeat(note.id, user)
+
+ result = ObjectView.render("object.json", %{object: announce_activity})
+
+ assert result["id"] == announce_activity.data["id"]
+ assert result["object"] == note.data["object"]["id"]
+ assert result["type"] == "Announce"
end
end