Introduce group posts

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-07-09 17:24:28 +02:00
parent bec1c69d4b
commit 9c9f1385fb
249 changed files with 11886 additions and 5023 deletions

View File

@@ -10,15 +10,11 @@ defmodule Mobilizon.Federation.ActivityPub.UtilsTest do
alias Mobilizon.Web.Endpoint
alias Mobilizon.Web.Router.Helpers, as: Routes
setup_all do
HTTPoison.start()
end
describe "make" do
test "comment data from struct" do
comment = insert(:comment)
tag = insert(:tag, title: "MyTag")
reply = insert(:comment, in_reply_to_comment: comment, tags: [tag])
reply = insert(:comment, in_reply_to_comment: comment, tags: [tag], attributed_to: nil)
assert %{
"type" => "Note",
@@ -42,8 +38,8 @@ defmodule Mobilizon.Federation.ActivityPub.UtilsTest do
end
test "comment data from map" do
comment = insert(:comment)
reply = insert(:comment, in_reply_to_comment: comment)
comment = insert(:comment, attributed_to: nil)
reply = insert(:comment, in_reply_to_comment: comment, attributed_to: nil)
to = ["https://www.w3.org/ns/activitystreams#Public"]
comment_data = Converter.Comment.model_to_as(reply)
assert comment_data["type"] == "Note"