Skip to content

Commit fa3478d

Browse files
author
David Zuckerman
committed
moved okcomputer registration for mail-connectivity outside of class
1 parent 865247b commit fa3478d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

config/initializers/okcomputer.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
require 'net/smtp'
2-
31
# frozen_string_literal: true
42

3+
require 'net/smtp'
4+
55
# Health check configuration
66

77
OkComputer.logger = Rails.logger
88
OkComputer.check_in_parallel = true
99

1010
class 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.
6666
OkComputer::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

spec/request/okcomputer_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
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

0 commit comments

Comments
 (0)