|
- package main
-
- import (
- "net/http"
- "net/http/httptest"
- "testing"
-
- "github.com/stretchr/testify/assert"
- )
-
- func TestConfigure(t *testing.T) {
- srv := Configure()
- request, _ := http.NewRequest("GET", "/", nil)
- response := httptest.NewRecorder()
- srv.ServeHTTP(response, request)
- assert.Equal(t, "pehpeh-api", response.Body.String(), "response body is expected")
- assert.Equal(t, 200, response.Code, "OK response is expected")
- }
|