commit d3843602523f61028af77f7fbb2e6c732918dea1
parent c3b17e82eb4a515a2fc1a9bd71b14431417ed9a9
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Mon, 18 Sep 2023 22:41:32 +0200
fix: server test
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/server_test.go b/server_test.go
@@ -1,8 +1,6 @@
package main
import (
- "github.com/in0rdr/go-webdav"
- "github.com/in0rdr/go-webdav/caldav"
"hivedav/config"
"net/http"
"net/http/httptest"
@@ -35,7 +33,7 @@ func TestServer(t *testing.T) {
// test curlable UI
request.Header.Set("user-agent", "curl/8.1.2")
- server.ServeHTTP(rr, request)
+ server.Index(rr, request, nil)
if err != nil {
t.Fatal("error creating new request:", err)
@@ -47,13 +45,13 @@ func TestServer(t *testing.T) {
}
welcome := rr.Body.String()
- if !strings.Contains(welcome, "hive") {
- t.Errorf("request to / does not contain word 'hive'")
+ if !strings.Contains(welcome, "Hive") {
+ t.Errorf("request to / does not contain word 'Hive'")
}
// test regular browser UI
request.Header.Set("user-agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36")
- server.ServeHTTP(rr, request)
+ server.Index(rr, request, nil)
if err != nil {
t.Fatal("error creating new request:", err)