mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-29 16:06:31 +00:00
19 lines
579 B
Elixir
19 lines
579 B
Elixir
defmodule RealtimeWeb.EndpointHttpTest do
|
|
use ExUnit.Case, async: true
|
|
import Plug.Test
|
|
|
|
test "the health probe answers 200" do
|
|
conn = RealtimeWeb.Endpoint.call(conn(:get, "/health"), [])
|
|
assert conn.status == 200
|
|
assert conn.resp_body == "ok"
|
|
end
|
|
|
|
test "any other HTTP path answers an empty 404" do
|
|
for path <- ["/", "/healthz", "/api/health", "/.git/HEAD", "/socket"] do
|
|
conn = RealtimeWeb.Endpoint.call(conn(:get, path), [])
|
|
assert conn.status == 404, "#{path} answered #{conn.status}"
|
|
assert conn.resp_body == ""
|
|
end
|
|
end
|
|
end
|