Add missing mailer for quote notifications (#35652)
This commit is contained in:
@@ -51,6 +51,27 @@ RSpec.describe NotificationMailer do
|
||||
it_behaves_like 'delivery without status'
|
||||
end
|
||||
|
||||
describe 'quote' do
|
||||
let(:quote) { Fabricate(:quote, state: :accepted, status: foreign_status, quoted_status: own_status) }
|
||||
let(:notification) { Notification.create!(account: receiver.account, activity: quote) }
|
||||
let(:mail) { prepared_mailer_for(own_status.account).quote }
|
||||
|
||||
it_behaves_like 'localized subject', 'notification_mailer.quote.subject', name: 'bob'
|
||||
|
||||
it 'renders the email' do
|
||||
expect(mail)
|
||||
.to be_present
|
||||
.and(have_subject('bob quoted your post'))
|
||||
.and(have_body_text('Your post was quoted by bob'))
|
||||
.and(have_body_text('The body of the foreign status'))
|
||||
.and have_thread_headers
|
||||
.and have_standard_headers('quote').for(receiver)
|
||||
end
|
||||
|
||||
it_behaves_like 'delivery to non functional user'
|
||||
it_behaves_like 'delivery without status'
|
||||
end
|
||||
|
||||
describe 'follow' do
|
||||
let(:follow) { sender.follow!(receiver.account) }
|
||||
let(:notification) { Notification.create!(account: receiver.account, activity: follow) }
|
||||
|
||||
@@ -33,6 +33,12 @@ class NotificationMailerPreview < ActionMailer::Preview
|
||||
mailer_for(activity.reblog.account, activity).reblog
|
||||
end
|
||||
|
||||
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/quote
|
||||
def quote
|
||||
activity = Quote.first
|
||||
mailer_for(activity.quoted_account, activity).quote
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def mailer_for(account, activity)
|
||||
|
||||
@@ -29,6 +29,7 @@ RSpec.describe 'API Web Push Subscriptions' do
|
||||
mention: false,
|
||||
poll: true,
|
||||
status: false,
|
||||
quote: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user