Micro-service for file storage and processing written in Go
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.

21 lines
486 B

  1. package main
  2. import (
  3. "net/http"
  4. "net/http/httptest"
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. )
  8. func TestIndexRoute(t *testing.T) {
  9. t.Run("test", func(t *testing.T) {
  10. request := httptest.NewRequest(http.MethodGet, "/", nil)
  11. responseRecorder := httptest.NewRecorder()
  12. IndexHandler(responseRecorder, request)
  13. assert.Equal(t, responseRecorder.Code, 200, "Response code should be 200")
  14. assert.NotNil(t, responseRecorder.Body, "Response should contain body")
  15. })
  16. }