discourse/spec/jobs/download_backup_email_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
546 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
RSpec.describe Jobs::DownloadBackupEmail do
fab!(:user) { Fabricate(:admin) }
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", email_prefix: SiteSetting.title),
)
2018-04-25 16:34:23 -04:00
expect(email.body.raw_source).to include(
"http://some.example.test/?token=#{EmailBackupToken.get(user.id)}",
)
end
end