2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-17 21:25:22 -06:00
|
|
|
RSpec.describe Jobs::DownloadBackupEmail do
|
2019-05-06 22:12:20 -05:00
|
|
|
fab!(:user) { Fabricate(:admin) }
|
2017-12-17 21:25:22 -06:00
|
|
|
|
|
|
|
it "should work" do
|
2023-01-09 05:18:21 -06:00
|
|
|
described_class.new.execute(user_id: user.id, backup_file_path: "http://some.example.test/")
|
2017-12-17 21:25:22 -06:00
|
|
|
|
|
|
|
email = ActionMailer::Base.deliveries.last
|
|
|
|
|
2023-01-09 05:18:21 -06:00
|
|
|
expect(email.subject).to eq(
|
|
|
|
I18n.t("download_backup_mailer.subject_template", email_prefix: SiteSetting.title),
|
|
|
|
)
|
2017-12-17 21:25:22 -06:00
|
|
|
|
2023-01-09 05:18:21 -06:00
|
|
|
expect(email.body.raw_source).to include(
|
|
|
|
"http://some.example.test/?token=#{EmailBackupToken.get(user.id)}",
|
|
|
|
)
|
2017-12-17 21:25:22 -06:00
|
|
|
end
|
|
|
|
end
|