defmodule ToweropsWeb.HealthControllerTest do
  use ToweropsWeb.ConnCase, async: true

  describe "GET /health" do
    test "returns ok with database connectivity check", %{conn: conn} do
      conn = get(conn, ~p"/health")

      assert json_response(conn, 200) == %{
               "status" => "ok",
               "database" => "connected",
               "version" => "0.1.0"
             }

      assert get_resp_header(conn, "content-type") == ["application/json; charset=utf-8"]
    end
  end
end
