Browse Source

Use correct mail method to deliver CSV email

pull/868/head
James Rose 2 years ago
parent
commit
947b2287f6
  1. 2
      app/jobs/email_csv_job.rb
  2. 4
      spec/jobs/email_csv_job_spec.rb

2
app/jobs/email_csv_job.rb

@ -16,6 +16,6 @@ class EmailCsvJob < ApplicationJob
url = storage_service.get_presigned_url(filename, EXPIRATION_TIME)
CsvDownloadMailer.new.send_email(user, url, EXPIRATION_TIME)
CsvDownloadMailer.new.send_csv_download_mail(user, url, EXPIRATION_TIME)
end
end

4
spec/jobs/email_csv_job_spec.rb

@ -35,7 +35,7 @@ describe EmailCsvJob do
allow(storage_service).to receive(:get_presigned_url).and_return(test_url)
allow(CsvDownloadMailer).to receive(:new).and_return(mailer)
allow(mailer).to receive(:send_email)
allow(mailer).to receive(:send_csv_download_mail)
end
it "uses an appropriate filename in S3" do
@ -49,7 +49,7 @@ describe EmailCsvJob do
end
it "sends an E-mail with the presigned URL and duration" do
expect(mailer).to receive(:send_email).with(user, test_url, instance_of(Integer))
expect(mailer).to receive(:send_csv_download_mail).with(user, test_url, instance_of(Integer))
job.perform(user)
end

Loading…
Cancel
Save