Skip to content

Commit 421cfb7

Browse files
committed
Add spec for heartbeat job
1 parent 5ceab3b commit 421cfb7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require "rails_helper"
2+
3+
RSpec.describe Emails::HeartbeatJob do
4+
describe "#perform" do
5+
it "sends a heartbeat email to admin users to exercise email provider integration" do
6+
admin_user = FactoryBot.create(:admin_user)
7+
8+
Emails::HeartbeatJob.perform_later
9+
10+
perform_enqueued_jobs_and_subsequently_enqueued_jobs
11+
12+
expect(ActionMailer::Base.deliveries.count).to eq(1)
13+
14+
mail = find_mail_to(admin_user.email)
15+
16+
expect(mail.subject).to eq("It’s alive!")
17+
end
18+
end
19+
end

0 commit comments

Comments
 (0)