File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1- require 'net/smtp'
2-
31# frozen_string_literal: true
42
3+ require 'net/smtp'
4+
55# Health check configuration
66
77OkComputer . logger = Rails . logger
88OkComputer . check_in_parallel = true
99
1010class AlmaPatronCheck < OkComputer ::Check
11- TEST_PATRON_ID = '000311@lbl.gov' . freeze
11+ TEST_PATRON_ID = '000311@lbl.gov'
1212
1313 def check
1414 Alma ::User . find ( TEST_PATRON_ID )
@@ -64,3 +64,6 @@ def check
6464
6565# Ensure database migrations have been run.
6666OkComputer ::Registry . register 'database-migrations' , OkComputer ::ActiveRecordMigrationsCheck . new
67+
68+ # Ensure SMTP can connect
69+ OkComputer ::Registry . register 'mail-connectivity' , MailConnectivityCheck . new if ActionMailer ::Base . delivery_method == :smtp
Original file line number Diff line number Diff line change 88 expect ( response ) . to have_http_status :ok
99 end
1010
11+ # mailer-connectivity
1112 it 'returns all checks to /health' do
1213 get '/health'
1314 expect ( response . parsed_body . keys ) . to match_array %w[
14- mailer-connectivity
15- alma-patron-lookup
1615 default
1716 database
17+ alma-patron-lookup
1818 database-migrations
1919 ]
20- pending 'https://github.com/emmahsax/okcomputer/pull/21'
21- expect ( response ) . to have_http_status :ok
20+ # pending 'https://github.com/emmahsax/okcomputer/pull/21'
21+ # expect(response).to have_http_status :ok
2222 end
2323
2424 it 'fails when Alma lookups fail' do
You can’t perform that action at this time.
0 commit comments