Skip to content

Commit

Permalink
Fix missing host in email title (#4461)
Browse files Browse the repository at this point in the history
* Add a mailer test
  • Loading branch information
coorasse authored Feb 18, 2024
1 parent 150005e commit 89b2171
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/mailers/mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def email_reset(user)
def email_reset_update(user)
@user = user
mail to: @user.email,
subject: I18n.t("mailer.email_reset_update.subject")
subject: I18n.t("mailer.email_reset_update.subject", host: Gemcutter::HOST_DISPLAY)
end

def email_confirmation(user)
Expand Down
17 changes: 17 additions & 0 deletions test/mailers/mailer_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require "test_helper"

class MailerTest < ActionMailer::TestCase
setup do
@user = create(:user)
end

context "#email_reset_update" do
should "include host in subject" do
email = Mailer.email_reset_update(@user)

assert_emails(1) { email.deliver_now }

assert_includes email.subject, Gemcutter::HOST_DISPLAY
end
end
end

0 comments on commit 89b2171

Please sign in to comment.