X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Femails%2Fmailer_test.exs;h=9e232d2a0b8fab77b33e40633d377c0e3d11eeb8;hb=9c672ecbb5d4477cd16d2139a2cb66d3923ac5c8;hp=2425c85dd38469aca08779b7e6bbb7f68729dce8;hpb=179fa32dd5d7b4cf1b338fc3df4840ae33525606;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"},