package apitest import ( "encoding/json" "net/http" "net/http/httptest" "testing" "git.artlef.fr/bibliomane/internal/dto" "git.artlef.fr/bibliomane/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) assert.Equal(t, false, appInfo.DemoMode) }