mirror of
https://github.com/rjNemo/go-wiki
synced 2026-06-06 10:46:40 +00:00
21 lines
379 B
Go
21 lines
379 B
Go
package controller
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/rjNemo/go-wiki/service"
|
|
)
|
|
|
|
func TestParseContactForm(t *testing.T) {
|
|
var i io.Reader
|
|
r, err := http.NewRequest(http.MethodPost, "/contact/post/", i)
|
|
if err != nil {
|
|
t.Errorf("%s", err)
|
|
}
|
|
ans := parseContactForm(r)
|
|
if ans != service.NewMail("", "") {
|
|
t.Errorf("parseContactForm(r) = %v", ans)
|
|
}
|
|
}
|