Skip to content

Commit

Permalink
fix: rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Oct 23, 2024
1 parent 6da7a8d commit ac99c6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: ENV['SMTP_DEFAULT_FROM']
default from: ENV.fetch('SMTP_DEFAULT_FROM', '[email protected]')
layout 'mailer'
end
2 changes: 1 addition & 1 deletion config/initializers/mailjet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
Mailjet.configure do |config|
config.api_key = ENV['SMTP_API_KEY']
config.secret_key = ENV['SMTP_API_SECRET']
config.default_from = ENV['SMTP_DEFAULT_FROM']
config.default_from = ENV.fetch('SMTP_DEFAULT_FROM', '[email protected]')
end
4 changes: 2 additions & 2 deletions spec/mailers/data_download_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
surname: 'surname',
location: 'location',
organisation: 'organisation',
purposes: ['purpose1', 'purpose2']
purposes: %w[purpose1 purpose2]
}
}
let(:mail) { DataDownloadMailer.send_download_file_info_email data }

it 'renders the headers' do
expect(mail.subject).to eq('TPI data has been downloaded')
expect(mail.to).to eq(['[email protected]'])
expect(mail.from).to eq([ENV['SMTP_DEFAULT_FROM']].reject(&:blank?))
expect(mail.from).to eq([ENV.fetch('SMTP_DEFAULT_FROM', '[email protected]')])

expect(mail.body.encoded).to include('[email protected]')
expect(mail.body.encoded).to include('job_title')
Expand Down

0 comments on commit ac99c6f

Please sign in to comment.