Apply Testing LiveView course patterns (live/2, has_element?, render_click, form/3). Add tests for MobileQRLive, WeathermapLive, StatusPageLive, controllers, plugs, and pure function modules. Expand proto decode coverage to 85.24%.
13 lines
388 B
Elixir
13 lines
388 B
Elixir
defmodule ToweropsWeb.HealthControllerTest do
|
|
use ToweropsWeb.ConnCase, async: true
|
|
|
|
describe "GET /health" do
|
|
test "returns 200 when database is connected", %{conn: conn} do
|
|
conn = get(conn, "/health")
|
|
body = response(conn, 200)
|
|
result = Jason.decode!(body)
|
|
assert result["status"] == "ok"
|
|
assert result["database"] == "connected"
|
|
end
|
|
end
|
|
end
|