-
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.
Merge pull request #741 from alphagov/add-tests-for-CD
Add new test to increase coverage for continuous deployment
- Loading branch information
Showing
4 changed files
with
31 additions
and
10 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
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 | ||
|
||
it "returns redis connections status" do | ||
json = JSON.parse(response.body) | ||
|
||
expect(response.status).to eq(200) | ||
expect(response.body).to eq("OK") | ||
expect(json["checks"]).to include("redis_connectivity") | ||
end | ||
end |