Skip to content

armgit / boop

Public Imported from GitHub
0

A tiny, self-hosted notification inbox for developers. Something happened in one of your apps; Boop tells you on your phone.

HTML
487 B
Raw Blame
package web

import (
	"net/http"
	"net/http/httptest"
	"testing"
)

func TestSPAFallback(t *testing.T) {
	h := Handler()
	for _, p := range []string{"/", "/events/evt_123", "/settings"} {
		rec := httptest.NewRecorder()
		h.ServeHTTP(rec, httptest.NewRequest("GET", p, nil))
		if rec.Code != http.StatusOK {
			t.Errorf("%s: status %d", p, rec.Code)
		}
		if ct := rec.Header().Get("Content-Type"); ct == "" || ct[:9] != "text/html" {
			t.Errorf("%s: content-type %q", p, ct)
		}
	}
}