debian-mirror-gitlab/workhorse/internal/helper/fail/fail_test.go
2023-03-05 14:24:40 +05:30

21 lines
383 B
Go

package fail
import (
"bytes"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/require"
)
func TestRequestWorksWithNils(t *testing.T) {
body := bytes.NewBuffer(nil)
w := httptest.NewRecorder()
w.Body = body
Request(w, nil, nil)
require.Equal(t, http.StatusInternalServerError, w.Code)
require.Equal(t, "Internal Server Error\n", body.String())
}