summaryrefslogtreecommitdiff
path: root/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs')
-rw-r--r--test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs
index 939922127..c854e6b32 100644
--- a/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs
+++ b/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs
@@ -33,6 +33,13 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AnnounceValidationTest do
assert {:ok, _object, _meta} = ObjectValidator.validate(valid_announce, [])
end
+ test "autogenerates a context ID", %{valid_announce: valid_announce} do
+ {:ok, %{"context" => context}, _} = ObjectValidator.validate(valid_announce, [])
+
+ assert String.starts_with?(context, "http://localhost:4001/contexts/")
+ assert String.length(context) == 67
+ end
+
test "returns an error if the object can't be found", %{valid_announce: valid_announce} do
without_object =
valid_announce