refactor: pre-cleanup.
This commit is contained in:
1 parent
0ceab9d897
commit
e10cbbc92c
53 files changed
+3596
-648
No files matched your search
@@ -256,6 +256,20 @@ func TestChatUpdateEndpoints(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestChatUpdateEndpointRejectsTypedNilService(t *testing.T) {
|
||||
var updates *releaseupdate.Service
|
||||
sessions := gateway.NewSessionStoreMemory("test")
|
||||
t.Cleanup(func() { _ = sessions.Close() })
|
||||
router := gateway.NewRouter(chatStatusStub{}, nil, "web")
|
||||
server := &Server{Chat: &ChatService{Router: router, Sessions: sessions, Updates: updates}}
|
||||
|
||||
res := httptest.NewRecorder()
|
||||
server.Handler().ServeHTTP(res, httptest.NewRequest(http.MethodGet, "/api/chat/update", nil))
|
||||
if res.Code != http.StatusNotImplemented {
|
||||
t.Fatalf("typed-nil update service status = %d, body = %s", res.Code, res.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestChatDangerousApprovalEndpoints(t *testing.T) {
|
||||
sessions := gateway.NewSessionStoreMemory("test")
|
||||
t.Cleanup(func() { _ = sessions.Close() })
|
||||
|
||||
Reference in new issue
Block a user