0
0
Fork 0

Update partials for the AdminMailer.new_trends mailer (#28011)

This commit is contained in:
Matt Jankowski 2023-11-21 05:52:20 -05:00 committed by GitHub
parent 3c3e0c25ef
commit 6d51ac246b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 15 additions and 138 deletions

View file

@ -63,12 +63,14 @@ RSpec.describe AdminMailer do
describe '.new_trends' do
let(:recipient) { Fabricate(:account, username: 'Snurf') }
let(:links) { [] }
let(:statuses) { [] }
let(:tags) { [] }
let(:mail) { described_class.with(recipient: recipient).new_trends(links, tags, statuses) }
let(:link) { Fabricate(:preview_card, trendable: true, language: 'en') }
let(:status) { Fabricate(:status) }
let(:tag) { Fabricate(:tag) }
let(:mail) { described_class.with(recipient: recipient).new_trends([link], [tag], [status]) }
before do
PreviewCardTrend.create!(preview_card: link)
StatusTrend.create!(status: status, account: Fabricate(:account))
recipient.user.update(locale: :en)
end
@ -79,6 +81,9 @@ RSpec.describe AdminMailer do
.and(deliver_from('notifications@localhost'))
.and(have_subject('New trends up for review on cb6e6126.ngrok.io'))
.and(have_body_text('The following items need a review before they can be displayed publicly'))
.and(have_body_text(ActivityPub::TagManager.instance.url_for(status)))
.and(have_body_text(link.title))
.and(have_body_text(tag.display_name))
end
end