20 lines
		
	
	
		
			328 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			328 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package main
 | 
						|
 | 
						|
import (
 | 
						|
	"net/http"
 | 
						|
	"testing"
 | 
						|
 | 
						|
	"git.32bit.cafe/32bitcafe/guestbook/internal/assert"
 | 
						|
)
 | 
						|
 | 
						|
func TestPing(t *testing.T) {
 | 
						|
	app := newTestApplication(t)
 | 
						|
	ts := newTestServer(t, app.routes())
 | 
						|
	defer ts.Close()
 | 
						|
 | 
						|
	code, _, body := ts.get(t, "/ping")
 | 
						|
 | 
						|
	assert.Equal(t, code, http.StatusOK)
 | 
						|
	assert.Equal(t, body, "OK")
 | 
						|
}
 |