Files
wrouter/auth/handler_test.go
T
2017-08-06 17:48:01 +02:00

33 lines
563 B
Go

package auth
import (
"net/http"
"net/url"
"strings"
"testing"
)
type handlerStruct struct{}
func (hs *handlerStruct) ServeHTTP(w http.ResponseWriter, req *http.Request) {
req.ParseForm() // Router does this in non-tests
if strings.HasPrefix(req.URL.Path, "/auth") {
Handler.Handle("/auth", w, req, nil)
return
}
}
func TestHandler(t *testing.T) {
auther := testAuther{FullName: "Test"}
Register(&auther)
form := url.Values{}
form.Set("username", "Test")
form.Set("password", "stuff'nthings")
t.Run("Register", func(t *testing.T) {
})
}