X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Femails%2Fmailer_test.exs;h=9e232d2a0b8fab77b33e40633d377c0e3d11eeb8;hb=073f5490ece616fd9602382c1be1347457cbbe79;hp=2425c85dd38469aca08779b7e6bbb7f68729dce8;hpb=f95a2b2cda236f7c0e5ced2a4698e2b10d99fa53;p=akkoma
diff --git a/test/emails/mailer_test.exs b/test/emails/mailer_test.exs
index 2425c85dd..9e232d2a0 100644
--- a/test/emails/mailer_test.exs
+++ b/test/emails/mailer_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.MailerTest do
@@ -14,12 +14,12 @@ defmodule Pleroma.Emails.MailerTest do
subject: "Pleroma test email",
to: [{"Test User", "user1@example.com"}]
}
-
- clear_config([Pleroma.Emails.Mailer, :enabled])
+ setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
test "not send email when mailer is disabled" do
- Pleroma.Config.put([Pleroma.Emails.Mailer, :enabled], false)
+ clear_config([Pleroma.Emails.Mailer, :enabled], false)
Mailer.deliver(@email)
+ :timer.sleep(100)
refute_email_sent(
from: {"Pleroma", "noreply@example.com"},
@@ -31,6 +31,7 @@ defmodule Pleroma.Emails.MailerTest do
test "send email" do
Mailer.deliver(@email)
+ :timer.sleep(100)
assert_email_sent(
from: {"Pleroma", "noreply@example.com"},
@@ -42,6 +43,7 @@ defmodule Pleroma.Emails.MailerTest do
test "perform" do
Mailer.perform(:deliver_async, @email, [])
+ :timer.sleep(100)
assert_email_sent(
from: {"Pleroma", "noreply@example.com"},