...

Source file src/edge-infra.dev/pkg/f8n/devinfra/ghappman/ghappman_test.go

Documentation: edge-infra.dev/pkg/f8n/devinfra/ghappman

     1  package ghappman
     2  
     3  import (
     4  	"net/http"
     5  	"net/http/httptest"
     6  	"testing"
     7  )
     8  
     9  // TODO: add more tests. convert to table over all routes
    10  func TestFormTemplate(t *testing.T) {
    11  	server := NewServer()
    12  	server.Sessions.startSession("bar", []byte(`hash`))
    13  
    14  	w := httptest.NewRecorder()
    15  	req, _ := http.NewRequest("GET", "/new-app?install_suffix=foo&state=bar", nil)
    16  	server.ServeHTTP(w, req)
    17  
    18  	if w.Code != http.StatusOK {
    19  		t.Errorf("got %d, not 200. bad", w.Code)
    20  	}
    21  }
    22  

View as plain text