From 66266ec6fc335937d319b8ea8687b2c2330f8d97 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 10 Dec 2024 09:45:40 -0500 Subject: [PATCH] Add coverage for `UserMailer#terms_of_service_changed` mailer (#33242) --- spec/mailers/user_mailer_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 025746581..0a128355b 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -272,4 +272,16 @@ RSpec.describe UserMailer do .and(have_body_text(I18n.t('user_mailer.backup_ready.explanation'))) end end + + describe '#terms_of_service_changed' do + let(:terms) { Fabricate :terms_of_service } + let(:mail) { described_class.terms_of_service_changed(receiver, terms) } + + it 'renders terms_of_service_changed mail' do + expect(mail) + .to be_present + .and(have_subject(I18n.t('user_mailer.terms_of_service_changed.subject'))) + .and(have_body_text(I18n.t('user_mailer.terms_of_service_changed.changelog'))) + end + end end