Merge branch 'email-tests' into 'develop'
Fix for sometimes failing email tests See merge request pleroma/pleroma!2906
This commit is contained in:
commit
4681771af4
|
@ -14,10 +14,10 @@ defmodule Pleroma.Emails.MailerTest do
|
||||||
subject: "Pleroma test email",
|
subject: "Pleroma test email",
|
||||||
to: [{"Test User", "user1@example.com"}]
|
to: [{"Test User", "user1@example.com"}]
|
||||||
}
|
}
|
||||||
setup do: clear_config([Pleroma.Emails.Mailer, :enabled])
|
setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
|
||||||
|
|
||||||
test "not send email when mailer is disabled" do
|
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)
|
Mailer.deliver(@email)
|
||||||
:timer.sleep(100)
|
:timer.sleep(100)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@ defmodule Mix.Tasks.Pleroma.DigestTest do
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
|
||||||
|
|
||||||
describe "pleroma.digest test" do
|
describe "pleroma.digest test" do
|
||||||
test "Sends digest to the given user" do
|
test "Sends digest to the given user" do
|
||||||
user1 = insert(:user)
|
user1 = insert(:user)
|
||||||
|
|
|
@ -16,6 +16,8 @@ defmodule Mix.Tasks.Pleroma.EmailTest do
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
|
||||||
|
|
||||||
describe "pleroma.email test" do
|
describe "pleroma.email test" do
|
||||||
test "Sends test email with no given address" do
|
test "Sends test email with no given address" do
|
||||||
mail_to = Config.get([:instance, :email])
|
mail_to = Config.get([:instance, :email])
|
||||||
|
|
Loading…
Reference in New Issue