mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-11 23:29:06 +02:00
Test
This commit is contained in:
parent
41514cd557
commit
d6762276f5
3 changed files with 40 additions and 33 deletions
server
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue