projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
[akkoma]
/
test
/
emails
/
mailer_test.exs
diff --git
a/test/emails/mailer_test.exs
b/test/emails/mailer_test.exs
index 450bb09c74e58e90db1d836135260e1a6e1125c2..3da45056bed564d0dbce77f7de2b6ba5f8c88e8d 100644
(file)
--- a/
test/emails/mailer_test.exs
+++ b/
test/emails/mailer_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
18
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.MailerTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.MailerTest do
@@
-14,16
+14,12
@@
defmodule Pleroma.Emails.MailerTest do
subject: "Pleroma test email",
to: [{"Test User", "user1@example.com"}]
}
subject: "Pleroma test email",
to: [{"Test User", "user1@example.com"}]
}
-
- setup do
- value = Pleroma.Config.get([Pleroma.Emails.Mailer, :enabled])
- on_exit(fn -> Pleroma.Config.put([Pleroma.Emails.Mailer, :enabled], value) end)
- :ok
- end
+ setup do: clear_config([Pleroma.Emails.Mailer, :enabled])
test "not send email when mailer is disabled" do
Pleroma.Config.put([Pleroma.Emails.Mailer, :enabled], false)
Mailer.deliver(@email)
test "not send email when mailer is disabled" do
Pleroma.Config.put([Pleroma.Emails.Mailer, :enabled], false)
Mailer.deliver(@email)
+ :timer.sleep(100)
refute_email_sent(
from: {"Pleroma", "noreply@example.com"},
refute_email_sent(
from: {"Pleroma", "noreply@example.com"},
@@
-35,6
+31,7
@@
defmodule Pleroma.Emails.MailerTest do
test "send email" do
Mailer.deliver(@email)
test "send email" do
Mailer.deliver(@email)
+ :timer.sleep(100)
assert_email_sent(
from: {"Pleroma", "noreply@example.com"},
assert_email_sent(
from: {"Pleroma", "noreply@example.com"},
@@
-46,6
+43,7
@@
defmodule Pleroma.Emails.MailerTest do
test "perform" do
Mailer.perform(:deliver_async, @email, [])
test "perform" do
Mailer.perform(:deliver_async, @email, [])
+ :timer.sleep(100)
assert_email_sent(
from: {"Pleroma", "noreply@example.com"},
assert_email_sent(
from: {"Pleroma", "noreply@example.com"},