1 Star 0 Fork 0

go/chitchat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
route_auth_test.go 502 Bytes
一键复制 编辑 原始数据 按行查看 历史
liu-jianhao 提交于 2018-08-16 22:43 . chitchat
package main
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
)
func Test_Get_Login(t *testing.T) {
mux := http.NewServeMux()
mux.HandleFunc("/login", login)
writer := httptest.NewRecorder()
request, _ := http.NewRequest("GET", "/login", nil)
mux.ServeHTTP(writer, request)
if writer.Code != 200 {
t.Errorf("Response code is %v", writer.Code)
}
body := writer.Body.String()
if strings.Contains(body, "Sign in") == false {
t.Errorf("Body does not contain Sign in")
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/go-program/chitchat.git
git@gitee.com:go-program/chitchat.git
go-program
chitchat
chitchat
master

搜索帮助