add mailer test
This commit is contained in:
parent
87741f4b49
commit
ad785278af
2 changed files with 18 additions and 0 deletions
|
@ -46,4 +46,18 @@ RSpec.describe InstructeurMailer, type: :mailer do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#notify_procedure_export_available' do
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let(:procedure) { create(:procedure, :published, instructeurs: [instructeur]) }
|
||||
let(:dossier) { create(:dossier, procedure: procedure) }
|
||||
let(:format) { 'xlsx' }
|
||||
|
||||
context 'when the mail is sent' do
|
||||
subject { described_class.notify_procedure_export_available(instructeur, procedure, format) }
|
||||
it 'contains a download link' do
|
||||
expect(subject.body).to include download_export_instructeur_procedure_url(procedure, :export_format => format)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,6 +37,10 @@ class InstructeurMailerPreview < ActionMailer::Preview
|
|||
InstructeurMailer.send_notifications(instructeur, data)
|
||||
end
|
||||
|
||||
def notify_procedure_export_available
|
||||
InstructeurMailer.notify_procedure_export_available(instructeur, procedure, 'xlsx')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def instructeur
|
||||
|
|
Loading…
Reference in a new issue