mirror of
https://github.com/mastodon/mastodon.git
synced 2026-09-15 01:26:24 -05:00
Fix relative privacy policy links in subscription emails (#40486)
This commit is contained in:
@@ -17,6 +17,6 @@
|
||||
|
||||
- content_for :footer do
|
||||
%p.email-footer-p= t('email_subscription_mailer.notification.footer.reason_for_email_html', name: display_name(@subscription.account), unsubscribe_path: @unsubscribe_url)
|
||||
%p.email-footer-p= t('email_subscription_mailer.notification.footer.privacy_html', domain: @instance, privacy_policy_path: privacy_policy_path)
|
||||
%p.email-footer-p= t('email_subscription_mailer.notification.footer.privacy_html', domain: @instance, privacy_policy_path: privacy_policy_url)
|
||||
- if Setting.email_footer_text.present?
|
||||
%p.email-footer-p= Setting.email_footer_text
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
- content_for :footer do
|
||||
%p.email-footer-p= t('.footer.reason_for_email_html', name: display_name(@subscription.account), unsubscribe_path: @unsubscribe_url)
|
||||
%p.email-footer-p= t('.footer.privacy_html', domain: @instance, privacy_policy_path: privacy_policy_path)
|
||||
%p.email-footer-p= t('.footer.privacy_html', domain: @instance, privacy_policy_path: privacy_policy_url)
|
||||
- if Setting.email_footer_text.present?
|
||||
%p.email-footer-p= Setting.email_footer_text
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe EmailSubscriptionMailer do
|
||||
shared_examples 'an absolute privacy policy link' do
|
||||
it 'links to the privacy policy with an absolute URL' do
|
||||
expect(mail.html_part.body.decoded)
|
||||
.to include(%(href="#{privacy_policy_url}"))
|
||||
end
|
||||
end
|
||||
|
||||
describe '.confirmation' do
|
||||
let(:email_subscription) { Fabricate(:email_subscription) }
|
||||
let(:mail) { described_class.with(subscription: email_subscription).confirmation }
|
||||
@@ -15,6 +22,8 @@ RSpec.describe EmailSubscriptionMailer do
|
||||
subject: I18n.t('email_subscription_mailer.confirmation.subject')
|
||||
)
|
||||
end
|
||||
|
||||
it_behaves_like 'an absolute privacy policy link'
|
||||
end
|
||||
|
||||
describe '.notification' do
|
||||
@@ -33,6 +42,8 @@ RSpec.describe EmailSubscriptionMailer do
|
||||
subject: I18n.t('email_subscription_mailer.notification.subject.singular', name: email_subscription.account.display_name, excerpt: statuses.first.text.truncate(17))
|
||||
)
|
||||
end
|
||||
|
||||
it_behaves_like 'an absolute privacy policy link'
|
||||
end
|
||||
|
||||
context 'with multiple statuses' do
|
||||
|
||||
Reference in New Issue
Block a user