-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add postgres and redis healthchecks for continuous deployment
- Loading branch information
1 parent
4ae231f
commit 3078972
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
RSpec.describe "healthcheck path", type: :request do | ||
it "should respond with 'OK'" do | ||
before do | ||
get "/healthcheck" | ||
end | ||
|
||
it "returns a 200 HTTP status" do | ||
expect(response).to have_http_status(:ok) | ||
end | ||
|
||
it "returns postgres connection status" do | ||
json = JSON.parse(response.body) | ||
|
||
expect(json["checks"]).to include("database_connectivity") | ||
end | ||
|
||
expect(response.status).to eq(200) | ||
expect(response.body).to eq("OK") | ||
it "returns redis connections status" do | ||
expect(data.fetch(:checks)).to include( | ||
redis_connectivity: { status: "ok" }, | ||
) | ||
end | ||
end |