debian-mirror-gitlab/workhorse/internal/helper/fail/fail_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
383 B
Go
Raw Normal View History

2023-03-04 22:38:38 +05:30
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())
}