Add ability to email announcements to all users (#33928)

This commit is contained in:
Claire 2025-03-06 15:05:27 +01:00 committed by GitHub
parent d2ce9a6064
commit 5a100bf38f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 275 additions and 11 deletions

View file

@ -317,4 +317,16 @@ RSpec.describe UserMailer do
.and(have_body_text(I18n.t('user_mailer.terms_of_service_changed.changelog')))
end
end
describe '#announcement_published' do
let(:announcement) { Fabricate :announcement }
let(:mail) { described_class.announcement_published(receiver, announcement) }
it 'renders announcement_published mail' do
expect(mail)
.to be_present
.and(have_subject(I18n.t('user_mailer.announcement_published.subject')))
.and(have_body_text(I18n.t('user_mailer.announcement_published.description', domain: Rails.configuration.x.local_domain)))
end
end
end