mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-21 23:44:30 +00:00
Fix tests
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
8d87cd12a9
commit
71cecb5b2c
5 changed files with 21 additions and 13 deletions
|
@ -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
|
||||
]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue