Fix tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-06-04 13:08:05 +02:00
parent 8d87cd12a9
commit 71cecb5b2c
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
5 changed files with 21 additions and 13 deletions

View File

@ -82,8 +82,3 @@ config :junit_formatter, report_dir: "."
if System.get_env("DOCKER", "false") == "false" && File.exists?("./config/test.secret.exs") do
import_config "test.secret.exs"
end
config :mobilizon, Mobilizon.Service.Notifier,
notifiers: [
Mobilizon.Service.Notifier.Mock
]

View File

@ -14,11 +14,6 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
setup %{conn: conn} do
group = insert(:group)
Mobilizon.Config.put([Mobilizon.Service.Notifier, :notifiers], [
Mobilizon.Service.Notifier.Email,
Mobilizon.Service.Notifier.Push
])
{:ok, conn: conn, group: group}
end

View File

@ -5,7 +5,7 @@ defmodule Mobilizon.Service.Workers.ActivityBuilderTest do
alias Mobilizon.Activities.Activity
alias Mobilizon.Actors.Actor
alias Mobilizon.Service.Notifier.Mock, as: NotifierMock
alias Mobilizon.Service.Notifier.Mock2, as: NotifierMock
alias Mobilizon.Service.Workers.ActivityBuilder
alias Mobilizon.Users.User
@ -14,6 +14,16 @@ defmodule Mobilizon.Service.Workers.ActivityBuilderTest do
import Mobilizon.Factory
import Mox
setup_all do
Mox.defmock(NotifierMock, for: Mobilizon.Service.Notifier)
Mobilizon.Config.put([Mobilizon.Service.Notifier, :notifiers], [
NotifierMock
])
:ok
end
setup :verify_on_exit!
describe "Sends direct email notification to users" do

View File

@ -15,6 +15,16 @@ defmodule Mobilizon.Service.Workers.LegacyNotifierBuilderTest do
import Mox
import Mobilizon.Factory
setup_all do
Mox.defmock(Mobilizon.Service.Notifier.Mock, for: Mobilizon.Service.Notifier)
Mobilizon.Config.put([Mobilizon.Service.Notifier, :notifiers], [
Mobilizon.Service.Notifier.Mock
])
:ok
end
@mentionned %{
"type" => "comment",
"subject" => "event_comment_mention",

View File

@ -79,6 +79,4 @@ defmodule Mobilizon.DataCase do
Mox.defmock(Mobilizon.Service.HTTP.GeospatialClient.Mock,
for: Tesla.Adapter
)
Mox.defmock(Mobilizon.Service.Notifier.Mock, for: Mobilizon.Service.Notifier)
end