@@ -2,15 +2,12 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.PostsTest do
|
||||
use Mobilizon.DataCase
|
||||
|
||||
import Mobilizon.Factory
|
||||
import Mox
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Federation.ActivityPub.{Activity, Transmogrifier}
|
||||
alias Mobilizon.Federation.ActivityStream.Convertible
|
||||
alias Mobilizon.Posts.Post
|
||||
|
||||
describe "handle incoming posts" do
|
||||
setup :verify_on_exit!
|
||||
|
||||
test "it ignores an incoming post if we already have it" do
|
||||
post = insert(:post)
|
||||
post = Repo.preload(post, [:author, :attributed_to, :picture, :media])
|
||||
|
||||
@@ -187,17 +187,18 @@ defmodule Mobilizon.Service.Workers.LegacyNotifierBuilderTest do
|
||||
"object_id" => to_string(comment_id)
|
||||
})
|
||||
|
||||
NotifierMock
|
||||
|> expect(:ready?, fn -> true end)
|
||||
|> expect(:send, fn %User{},
|
||||
%Activity{
|
||||
type: :comment,
|
||||
subject: :participation_event_comment,
|
||||
object_type: :comment
|
||||
},
|
||||
[single_activity: true] ->
|
||||
{:ok, :sent}
|
||||
end)
|
||||
# # Disabled as announcement is sent straight away
|
||||
# NotifierMock
|
||||
# |> expect(:ready?, fn -> true end)
|
||||
# |> expect(:send, fn %User{},
|
||||
# %Activity{
|
||||
# type: :comment,
|
||||
# subject: :participation_event_comment,
|
||||
# object_type: :comment
|
||||
# },
|
||||
# [single_activity: true] ->
|
||||
# {:ok, :sent}
|
||||
# end)
|
||||
|
||||
assert :ok == LegacyNotifierBuilder.perform(%Oban.Job{args: args})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user