From 74112ef99e84f9f19d278faaa8e231b9ea867b2b Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 23 Mar 2017 21:22:49 +0100 Subject: Add id to objects, too. --- test/web/activity_pub/activity_pub_test.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/web/activity_pub') diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index 613c5a04f..6a5138012 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -24,6 +24,17 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert activity.data["ok"] == data["ok"] assert activity.data["id"] == given_id end + + test "adds an id to a given object if it lacks one" do + data = %{ + "object" => %{ + "ok" => true + } + } + + {:ok, %Activity{} = activity} = ActivityPub.insert(data) + assert is_binary(activity.data["object"]["id"]) + end end describe "fetch activities for recipients" do -- cgit v1.2.3