Add config to disable registration
This commit is contained in:
30
internal/apitest/get_appinfo_test.go
Normal file
30
internal/apitest/get_appinfo_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package apitest
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"git.artlef.fr/PersonalLibraryManager/internal/dto"
|
||||
"git.artlef.fr/PersonalLibraryManager/internal/testutils"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetAppInfo_Ok(t *testing.T) {
|
||||
router := testutils.TestSetup()
|
||||
|
||||
req, _ := http.NewRequest("GET", "/ws/appinfo", nil)
|
||||
w := httptest.NewRecorder()
|
||||
router.ServeHTTP(w, req)
|
||||
|
||||
var appInfo dto.AppInfo
|
||||
|
||||
err := json.Unmarshal(w.Body.Bytes(), &appInfo)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
assert.Equal(t, http.StatusOK, w.Code)
|
||||
|
||||
assert.Equal(t, false, appInfo.RegistrationDisabled)
|
||||
}
|
||||
Reference in New Issue
Block a user