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

  describe "index" do
    test "renders API docs page for unauthenticated user", %{conn: conn} do
      conn = get(conn, ~p"/docs/api")

      assert html_response(conn, 200) =~ "API"
    end

    test "renders API docs page for authenticated user", %{conn: conn} do
      conn = register_and_log_in_user(%{conn: conn}).conn
      conn = get(conn, ~p"/docs/api")

      assert html_response(conn, 200) =~ "API"
    end
  end
end
