aboutsummaryrefslogtreecommitdiff
path: root/test/web
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-11-10 11:50:02 +0000
committerkaniini <nenolod@gmail.com>2018-11-10 11:50:02 +0000
commitc9c1f9dee2fe12fe55703255497f4a14eb0d4e13 (patch)
treec92a380294e3ab19eaa96c0778fa9b50affac996 /test/web
parent7daa102fa4248dd518deb85b6f74dffd59444724 (diff)
parentc9df0112155c066a6120675a8b5d974564e9ccb4 (diff)
downloadpleroma-c9c1f9dee2fe12fe55703255497f4a14eb0d4e13.tar.gz
Merge branch 'bugfix/ostatus-as2-reflection' into 'develop'
ostatus: only federate activities concerning note objects See merge request pleroma/pleroma!437
Diffstat (limited to 'test/web')
-rw-r--r--test/web/ostatus/ostatus_test.exs24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs
index f095e41dd..f95da8b0a 100644
--- a/test/web/ostatus/ostatus_test.exs
+++ b/test/web/ostatus/ostatus_test.exs
@@ -456,4 +456,28 @@ defmodule Pleroma.Web.OStatusTest do
"https://www.w3.org/ns/activitystreams#Public"
]
end
+
+ describe "is_representable?" do
+ test "Note objects are representable" do
+ note_activity = insert(:note_activity)
+
+ assert OStatus.is_representable?(note_activity)
+ end
+
+ test "Article objects are not representable" do
+ note_activity = insert(:note_activity)
+
+ note_object = Object.normalize(note_activity.data["object"])
+
+ note_data =
+ note_object.data
+ |> Map.put("type", "Article")
+
+ cs = Object.change(note_object, %{data: note_data})
+ {:ok, article_object} = Repo.update(cs)
+
+ # the underlying object is now an Article instead of a note, so this should fail
+ refute OStatus.is_representable?(note_activity)
+ end
+ end
end