oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package equipo
2
3import (
4 "net/http"
5 "net/http/httptest"
6 "testing"
7)
8
9func TestSigninNilAuthFailsClosed(t *testing.T) {
10 a := &application{}
11 called := false
12 h := a.requireMember(http.HandlerFunc(func(http.ResponseWriter, *http.Request) { called = true }))
13 w := httptest.NewRecorder()
14 h.ServeHTTP(w, httptest.NewRequest(http.MethodGet, "/private", nil))
15 if called || w.Code != http.StatusServiceUnavailable {
16 t.Fatal("nil auth granted access")
17 }
18}
19