diff --git a/push_test.go b/push_test.go index f9c021cd..f5dd0bdc 100644 --- a/push_test.go +++ b/push_test.go @@ -235,6 +235,35 @@ func TestCiphertext(t *testing.T) { }) } +func TestBatchPush(t *testing.T) { + Endpoint(t, []APITestCase{ + { + Name: "Batch Push", + Method: "POST", + URL: "/" + key, + Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\":[\"" + key + "\",\"" + key + "\",\"" + key + "\"]}", + IsJson: true, + WantStatusCode: 200, + }, + { + Name: "Batch Push", + Method: "POST", + URL: "/push", + Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\":[\"" + key + "\",\"" + key + "\",\"" + key + "\"]}", + IsJson: true, + WantStatusCode: 200, + }, + { + Name: "Batch Push", + Method: "POST", + URL: "/push", + Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\": \"" + key + "," + key + "," + key + "\"}", + IsJson: true, + WantStatusCode: 200, + }, + }) +} + type APITestCase struct { Name string Method string