Fix tests
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
8d87cd12a9
commit
71cecb5b2c
@ -82,8 +82,3 @@ config :junit_formatter, report_dir: "."
|
|||||||
if System.get_env("DOCKER", "false") == "false" && File.exists?("./config/test.secret.exs") do
|
if System.get_env("DOCKER", "false") == "false" && File.exists?("./config/test.secret.exs") do
|
||||||
import_config "test.secret.exs"
|
import_config "test.secret.exs"
|
||||||
end
|
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
|
setup %{conn: conn} do
|
||||||
group = insert(:group)
|
group = insert(:group)
|
||||||
|
|
||||||
Mobilizon.Config.put([Mobilizon.Service.Notifier, :notifiers], [
|
|
||||||
Mobilizon.Service.Notifier.Email,
|
|
||||||
Mobilizon.Service.Notifier.Push
|
|
||||||
])
|
|
||||||
|
|
||||||
{:ok, conn: conn, group: group}
|
{:ok, conn: conn, group: group}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ defmodule Mobilizon.Service.Workers.ActivityBuilderTest do
|
|||||||
|
|
||||||
alias Mobilizon.Activities.Activity
|
alias Mobilizon.Activities.Activity
|
||||||
alias Mobilizon.Actors.Actor
|
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.Service.Workers.ActivityBuilder
|
||||||
alias Mobilizon.Users.User
|
alias Mobilizon.Users.User
|
||||||
|
|
||||||
@ -14,6 +14,16 @@ defmodule Mobilizon.Service.Workers.ActivityBuilderTest do
|
|||||||
import Mobilizon.Factory
|
import Mobilizon.Factory
|
||||||
import Mox
|
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!
|
setup :verify_on_exit!
|
||||||
|
|
||||||
describe "Sends direct email notification to users" do
|
describe "Sends direct email notification to users" do
|
||||||
|
@ -15,6 +15,16 @@ defmodule Mobilizon.Service.Workers.LegacyNotifierBuilderTest do
|
|||||||
import Mox
|
import Mox
|
||||||
import Mobilizon.Factory
|
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 %{
|
@mentionned %{
|
||||||
"type" => "comment",
|
"type" => "comment",
|
||||||
"subject" => "event_comment_mention",
|
"subject" => "event_comment_mention",
|
||||||
|
@ -79,6 +79,4 @@ defmodule Mobilizon.DataCase do
|
|||||||
Mox.defmock(Mobilizon.Service.HTTP.GeospatialClient.Mock,
|
Mox.defmock(Mobilizon.Service.HTTP.GeospatialClient.Mock,
|
||||||
for: Tesla.Adapter
|
for: Tesla.Adapter
|
||||||
)
|
)
|
||||||
|
|
||||||
Mox.defmock(Mobilizon.Service.Notifier.Mock, for: Mobilizon.Service.Notifier)
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user