From c68bcae362921a16dfb0995539a97ca521036dd7 Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Wed, 19 Aug 2020 12:57:29 +0300 Subject: [PATCH] fix for sometimes failing tests --- test/emails/mailer_test.exs | 4 ++-- test/tasks/digest_test.exs | 2 ++ test/tasks/email_test.exs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/emails/mailer_test.exs b/test/emails/mailer_test.exs index 3da45056b..9e232d2a0 100644 --- a/test/emails/mailer_test.exs +++ b/test/emails/mailer_test.exs @@ -14,10 +14,10 @@ defmodule Pleroma.Emails.MailerTest do subject: "Pleroma test email", 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 - Pleroma.Config.put([Pleroma.Emails.Mailer, :enabled], false) + clear_config([Pleroma.Emails.Mailer, :enabled], false) Mailer.deliver(@email) :timer.sleep(100) diff --git a/test/tasks/digest_test.exs b/test/tasks/digest_test.exs index eefbc8936..0b444c86d 100644 --- a/test/tasks/digest_test.exs +++ b/test/tasks/digest_test.exs @@ -17,6 +17,8 @@ defmodule Mix.Tasks.Pleroma.DigestTest do :ok end + setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true) + describe "pleroma.digest test" do test "Sends digest to the given user" do user1 = insert(:user) diff --git a/test/tasks/email_test.exs b/test/tasks/email_test.exs index 944c07064..c3af7ef68 100644 --- a/test/tasks/email_test.exs +++ b/test/tasks/email_test.exs @@ -16,6 +16,8 @@ defmodule Mix.Tasks.Pleroma.EmailTest do :ok end + setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true) + describe "pleroma.email test" do test "Sends test email with no given address" do mail_to = Config.get([:instance, :email])