mirror of
				https://github.com/photoprism/photoprism.git
				synced 2025-10-31 04:06:43 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			445 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			445 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package api
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| 	"github.com/tidwall/gjson"
 | |
| )
 | |
| 
 | |
| func TestGetStatus(t *testing.T) {
 | |
| 	t.Run("successful request", func(t *testing.T) {
 | |
| 		app, router, _ := NewApiTest()
 | |
| 		GetStatus(router)
 | |
| 		r := PerformRequest(app, "GET", "/api/v1/status")
 | |
| 		val := gjson.Get(r.Body.String(), "status")
 | |
| 		assert.Equal(t, "operational", val.String())
 | |
| 		assert.Equal(t, http.StatusOK, r.Code)
 | |
| 	})
 | |
| }
 | 
