pehpeh API server in golang
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 line
432B

  1. package main
  2. import (
  3. "net/http"
  4. "net/http/httptest"
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. )
  8. func TestConfigure(t *testing.T) {
  9. srv := Configure()
  10. request, _ := http.NewRequest("GET", "/", nil)
  11. response := httptest.NewRecorder()
  12. srv.ServeHTTP(response, request)
  13. assert.Equal(t, "pehpeh-api", response.Body.String(), "response body is expected")
  14. assert.Equal(t, 200, response.Code, "OK response is expected")
  15. }