forked from rubyforgood/human-essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreminder_deadline_mailer_spec.rb
39 lines (31 loc) · 1.22 KB
/
reminder_deadline_mailer_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
RSpec.describe ReminderDeadlineMailer, type: :job do
let(:organization) { create(:organization) }
describe 'notify deadline' do
let(:today) { Date.new(2022, 1, 10) }
let(:partner) { create(:partner, organization: organization) }
before(:each) do
organization.reminder_email_text = "Custom reminder message"
organization.update!(reminder_day: today.day, deadline_day: 1)
end
subject { described_class.notify_deadline(partner) }
it 'renders the subject' do
expect(subject.subject).to eq("#{organization.name} Deadline Reminder")
end
it 'renders the receiver email' do
expect(subject.to).to contain_exactly(partner.email)
end
it 'renders the sender email' do
end
it 'renders the body' do
travel_to today do
expect(subject.body.encoded)
.to include("This is a friendly reminder that #{organization.name} requires your human essentials requests to " \
"be submitted by Tue, 01 Feb 2022")
end
end
it 'renders the body with the reminder email text' do
expect(subject.body.encoded).to include("Custom reminder message")
end
end
end