Merge branch 'test/add-one-test-to-transmogrifier' into 'master'
Add one test to transmogrifier See merge request framasoft/mobilizon!354
This commit is contained in:
commit
32463da930
@ -15,7 +15,7 @@ defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
|
|||||||
alias Mobilizon.Actors.Actor
|
alias Mobilizon.Actors.Actor
|
||||||
alias Mobilizon.Events.{Comment, Event, Participant}
|
alias Mobilizon.Events.{Comment, Event, Participant}
|
||||||
alias Mobilizon.Service.ActivityPub
|
alias Mobilizon.Service.ActivityPub
|
||||||
alias Mobilizon.Service.ActivityPub.{Activity, Utils}
|
alias Mobilizon.Service.ActivityPub.{Activity, Utils, Convertible}
|
||||||
alias Mobilizon.Service.ActivityPub.Transmogrifier
|
alias Mobilizon.Service.ActivityPub.Transmogrifier
|
||||||
|
|
||||||
alias MobilizonWeb.API
|
alias MobilizonWeb.API
|
||||||
@ -71,25 +71,23 @@ defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "handle incoming notices" do
|
describe "handle incoming notices" do
|
||||||
# test "it ignores an incoming comment if we already have it" do
|
test "it ignores an incoming comment if we already have it" do
|
||||||
# comment = insert(:comment)
|
comment = insert(:comment)
|
||||||
|
|
||||||
# activity = %{
|
activity = %{
|
||||||
# "type" => "Create",
|
"type" => "Create",
|
||||||
# "to" => ["https://www.w3.org/ns/activitystreams#Public"],
|
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
# "actor" => comment.actor.url,
|
"actor" => comment.actor.url,
|
||||||
# "object" => Utils.make_comment_data(comment)
|
"object" => Convertible.model_to_as(comment)
|
||||||
# }
|
}
|
||||||
|
|
||||||
# data =
|
data =
|
||||||
# File.read!("test/fixtures/mastodon-post-activity.json")
|
File.read!("test/fixtures/mastodon-post-activity.json")
|
||||||
# |> Jason.decode!()
|
|> Jason.decode!()
|
||||||
# |> Map.put("object", activity["object"])
|
|> Map.put("object", activity["object"])
|
||||||
|
|
||||||
# {:ok, returned_activity, _} = Transmogrifier.handle_incoming(data)
|
assert {:ok, nil, _} = Transmogrifier.handle_incoming(data)
|
||||||
|
end
|
||||||
# assert activity == returned_activity.data
|
|
||||||
# end
|
|
||||||
|
|
||||||
test "it fetches replied-to activities if we don't have them" do
|
test "it fetches replied-to activities if we don't have them" do
|
||||||
data =
|
data =
|
||||||
|
Loading…
Reference in New Issue
Block a user