X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Femails%2Fuser_email_test.exs;h=56455200463475e6c3e2833a1df7a1c2ab941b72;hb=ccdf55acff7ff7d29682aab3ccf283b59ad33d26;hp=21fd06ea67c4a03d736c7f8e4698797efcd1be76;hpb=e3508988283a0902a7e330995a0c224811956bce;p=akkoma diff --git a/test/pleroma/emails/user_email_test.exs b/test/pleroma/emails/user_email_test.exs index 21fd06ea6..564552004 100644 --- a/test/pleroma/emails/user_email_test.exs +++ b/test/pleroma/emails/user_email_test.exs @@ -27,7 +27,7 @@ defmodule Pleroma.Emails.UserEmailTest do token = %Pleroma.UserInviteToken{token: "test-token"} email = UserEmail.user_invitation_email(user, token, "test@test.com", "Jonh") assert email.from == {config[:name], config[:notify_email]} - assert email.subject == "Invitation to Pleroma" + assert email.subject == "Invitation to Akkoma" assert email.to == [{"Jonh", "test@test.com"}] assert email.html_body =~ @@ -56,4 +56,16 @@ defmodule Pleroma.Emails.UserEmailTest do assert email.subject == "Your account is awaiting approval" assert email.html_body =~ "Awaiting Approval" end + + test "email i18n" do + user = insert(:user, language: "en_test") + email = UserEmail.approval_pending_email(user) + assert email.subject == "xxYour account is awaiting approvalxx" + end + + test "email i18n should fallback to default locale if user language is unsupported" do + user = insert(:user, language: "unsupported") + email = UserEmail.approval_pending_email(user) + assert email.subject == "Your account is awaiting approval" + end end