1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-11 23:29:06 +02:00
This commit is contained in:
Philipp Heckel 2021-12-25 22:07:55 +01:00
parent 41514cd557
commit d6762276f5
3 changed files with 40 additions and 33 deletions

View file

@ -583,6 +583,13 @@ func TestServer_PublishEmailNoMailer_Fail(t *testing.T) {
require.Equal(t, 400, response.Code)
}
func TestServer_UnifiedPushDiscovery(t *testing.T) {
s := newTestServer(t, newTestConfig(t))
response := request(t, s, "GET", "/mytopic?up=1", "", nil)
require.Equal(t, 200, response.Code)
require.Equal(t, `{"unifiedpush":{"version":1}}`+"\n", response.Body.String())
}
func newTestConfig(t *testing.T) *Config {
conf := NewConfig()
conf.CacheFile = filepath.Join(t.TempDir(), "cache.db")