/*
* This file is part of sdbapi
* Copyright (C) 2022 Jonni Liljamo <jonni@liljamo.com>
*
* Licensed under GPL-3.0-only.
* See LICENSE for licensing information.
*/
package main
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
)
func TestMiscInfo(t *testing.T) {
r := createRouter()
w := httptest.NewRecorder()
req, _ := http.NewRequest("GET", "/api/info", nil)
r.ServeHTTP(w, req)
expected := "{\"info\":\"Deck Builder API\",\"ver\":\"0.0.1\"}"
assert.Equal(t, http.StatusOK, w.Code)
assert.Equal(t, expected, w.Body.String())
}