|  | @@ -1,7 +1,9 @@
 | 
	
		
			
				|  |  |  package helpers_test
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import (
 | 
	
		
			
				|  |  | +	"io"
 | 
	
		
			
				|  |  |  	"net/http"
 | 
	
		
			
				|  |  | +	"net/http/httptest"
 | 
	
		
			
				|  |  |  	"testing"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	. "github.com/onsi/ginkgo"
 | 
	
	
		
			
				|  | @@ -10,6 +12,9 @@ import (
 | 
	
		
			
				|  |  |  )
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  var _ = Describe("helpers", func() {
 | 
	
		
			
				|  |  | +	var srv *httptest.Server
 | 
	
		
			
				|  |  | +	var client *http.Client
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	Context("ClientIP", func() {
 | 
	
		
			
				|  |  |  		It("return client IP", func() {
 | 
	
		
			
				|  |  |  			Expect(helpers.ClientIP(&http.Request{
 | 
	
	
		
			
				|  | @@ -68,6 +73,31 @@ var _ = Describe("helpers", func() {
 | 
	
		
			
				|  |  |  		})
 | 
	
		
			
				|  |  |  	})
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	Context("HandleAppStatus", func() {
 | 
	
		
			
				|  |  | +		BeforeEach(func() {
 | 
	
		
			
				|  |  | +			srv = httptest.NewServer(helpers.HandleAppStatus())
 | 
	
		
			
				|  |  | +			client = srv.Client()
 | 
	
		
			
				|  |  | +		})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		AfterEach(func() {
 | 
	
		
			
				|  |  | +			srv.Close()
 | 
	
		
			
				|  |  | +		})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		It("handle app status", func() {
 | 
	
		
			
				|  |  | +			resp, err := client.Get(srv.URL + "/")
 | 
	
		
			
				|  |  | +			Expect(err).To(Succeed())
 | 
	
		
			
				|  |  | +			defer resp.Body.Close()
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			Expect(resp.StatusCode).To(Equal(http.StatusOK))
 | 
	
		
			
				|  |  | +			Expect(resp.Header.Get("Content-Type")).To(Equal("application/json"))
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			body, err := io.ReadAll(resp.Body)
 | 
	
		
			
				|  |  | +			Expect(err).To(Succeed())
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			Expect(string(body)).To(MatchRegexp(`{"memory":{"alloc":[0-9]+,"num_gc":[0-9]+,"sys":[0-9]+,"total_alloc":[0-9]+},"routines":[0-9]+}`))
 | 
	
		
			
				|  |  | +		})
 | 
	
		
			
				|  |  | +	})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	Context("MinifyHtmlCode", func() {
 | 
	
		
			
				|  |  |  		It("minify Html code", func() {
 | 
	
		
			
				|  |  |  			Expect(helpers.MinifyHtmlCode(`
 |