From 49125e3dad178d586139b9864f85b92a98362b15 Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Sat, 17 Aug 2019 20:24:49 +1200 Subject: [PATCH] Change push-type tests for better coverage (#144) --- client_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client_test.go b/client_test.go index 29d02e45..974a4ab1 100644 --- a/client_test.go +++ b/client_test.go @@ -171,17 +171,14 @@ func TestHeaders(t *testing.T) { n.Topic = "com.testapp" n.Priority = 10 n.Expiration = time.Now() + n.PushType = apns.PushTypeBackground server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { assert.Equal(t, n.ApnsID, r.Header.Get("apns-id")) assert.Equal(t, n.CollapseID, r.Header.Get("apns-collapse-id")) assert.Equal(t, "10", r.Header.Get("apns-priority")) assert.Equal(t, n.Topic, r.Header.Get("apns-topic")) assert.Equal(t, fmt.Sprintf("%v", n.Expiration.Unix()), r.Header.Get("apns-expiration")) - if n.PushType == "" { - assert.Equal(t, "alert", r.Header.Get("apns-push-type")) - } else { - assert.Equal(t, n.PushType, r.Header.Get("apns-push-type")) - } + assert.Equal(t, "background", r.Header.Get("apns-push-type")) })) defer server.Close() _, err := mockClient(server.URL).Push(n)