X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fuser%2Fwelcome_email_test.exs;h=d005d11b23121d3e31f89e65b9f360dbd776dac4;hb=7dd986a563545cb63e8404d9b107f1d29c499940;hp=1a80109d4c60308402f977cac76d03b3cd933828;hpb=7cafb96c02c569209b4684a237311a0e14648185;p=akkoma diff --git a/test/user/welcome_email_test.exs b/test/user/welcome_email_test.exs index 1a80109d4..d005d11b2 100644 --- a/test/user/welcome_email_test.exs +++ b/test/user/welcome_email_test.exs @@ -16,11 +16,10 @@ defmodule Pleroma.User.WelcomeEmailTest do describe "send_email/1" do test "send a welcome email" do - welcome_user = insert(:user) user = insert(:user, name: "Jimm") Config.put([:welcome, :email, :enabled], true) - Config.put([:welcome, :email, :sender_nickname], welcome_user.nickname) + Config.put([:welcome, :email, :sender], "welcome@pleroma.app") Config.put( [:welcome, :email, :subject], @@ -39,7 +38,20 @@ defmodule Pleroma.User.WelcomeEmailTest do ObanHelpers.perform_all() assert_email_sent( - from: {instance_name, welcome_user.email}, + from: {instance_name, "welcome@pleroma.app"}, + to: {user.name, user.email}, + subject: "Hello, welcome to pleroma: #{instance_name}", + html_body: "
Welcome to #{instance_name}
" + ) + + Config.put([:welcome, :email, :sender], {"Pleroma App", "welcome@pleroma.app"}) + + {:ok, _job} = WelcomeEmail.send_email(user) + + ObanHelpers.perform_all() + + assert_email_sent( + from: {"Pleroma App", "welcome@pleroma.app"}, to: {user.name, user.email}, subject: "Hello, welcome to pleroma: #{instance_name}", html_body: "Welcome to #{instance_name}
"