github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/webapp/about_handler_medium_test.go (about)

     1  // +build medium
     2  
     3  package webapp
     4  
     5  import (
     6  	"io/ioutil"
     7  	"net/http"
     8  	"net/http/httptest"
     9  	"testing"
    10  
    11  	"github.com/stretchr/testify/assert"
    12  
    13  	"github.com/web-platform-tests/wpt.fyi/shared/sharedtest"
    14  )
    15  
    16  func TestAboutHandler(t *testing.T) {
    17  	i, err := sharedtest.NewAEInstance(true)
    18  	assert.Nil(t, err)
    19  	defer i.Close()
    20  	req, err := i.NewRequest("GET", "/about", nil)
    21  	assert.Nil(t, err)
    22  	resp := httptest.NewRecorder()
    23  	aboutHandler(resp, req)
    24  	assert.Equal(t, resp.Code, http.StatusOK)
    25  	body, _ := ioutil.ReadAll(resp.Body)
    26  	assert.Contains(t, string(body), "local dev_appserver")
    27  }