0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/spec/jobs/download_backup_email_spec.rb
David Battersby 5f710afcc3
FEATURE: better email subject lines (#36040)
When enabled, the email subject lines will be more concise, with a focus
on only essential information. This makes it easier for users to quickly
understand the purpose of the email at a glance.

This feature uses upcoming changes to roll out the changes to email
subjects.

The main change to be aware of is that when enabling this upcoming
change, it will update the site setting for `email_subject`. Disabling
the upcoming change will revert the email subject setting back to it's
default value, meaning that customizations to the setting could be lost.

Internal ref - /t/154689
2026-04-24 15:14:10 +04:00

21 lines
595 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe Jobs::DownloadBackupEmail do
fab!(:user, :admin)
before { SiteSetting.simple_email_subject = true }
it "should work" do
described_class.new.execute(user_id: user.id, backup_file_path: "http://some.example.test/")
email = ActionMailer::Base.deliveries.last
expect(email.subject).to eq(
I18n.t("download_backup_mailer.subject_template_improved", email_prefix: SiteSetting.title),
)
expect(email.body.raw_source).to include(
"http://some.example.test/?token=#{EmailBackupToken.get(user.id)}",
)
end
end