Fix tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-11-12 18:17:53 +01:00
parent 0900eb730e
commit a04dfc5293
29 changed files with 645 additions and 508 deletions

View File

@@ -7,13 +7,14 @@ defmodule MobilizonWeb.ActivityPub.ObjectView do
def render("event.json", %{event: event}) do
event = %{
"type" => "Event",
"id" => event.url,
"name" => event.title,
"category" => render_one(event.category, ObjectView, "category.json", as: :category),
"content" => event.description,
"mediaType" => "text/html",
"published" => Timex.format!(event.inserted_at, "{ISO:Extended}"),
"updated" => Timex.format!(event.updated_at, "{ISO:Extended}")
"actor" => event["actor"],
"id" => event["id"],
"name" => event["title"],
"category" => render_one(event["category"], ObjectView, "category.json", as: :category),
"content" => event["summary"],
"mediaType" => "text/html"
# "published" => Timex.format!(event.inserted_at, "{ISO:Extended}"),
# "updated" => Timex.format!(event.updated_at, "{ISO:Extended}")
}
Map.merge(event, Utils.make_json_ld_header())
@@ -21,16 +22,16 @@ defmodule MobilizonWeb.ActivityPub.ObjectView do
def render("comment.json", %{comment: comment}) do
comment = %{
"actor" => comment.actor.url,
"uuid" => comment.uuid,
"actor" => comment["actor"],
"uuid" => comment["uuid"],
# The activity should have attributedTo, not the comment itself
# "attributedTo" => comment.attributed_to,
"type" => "Note",
"id" => comment.url,
"content" => comment.text,
"mediaType" => "text/html",
"published" => Timex.format!(comment.inserted_at, "{ISO:Extended}"),
"updated" => Timex.format!(comment.updated_at, "{ISO:Extended}")
"id" => comment["id"],
"content" => comment["content"],
"mediaType" => "text/html"
# "published" => Timex.format!(comment.inserted_at, "{ISO:Extended}"),
# "updated" => Timex.format!(comment.updated_at, "{ISO:Extended}")
}
Map.merge(comment, Utils.make_json_ld_header())