From 069efa9e5ee493246b01386c19c8577893c6dbbb Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 11 Apr 2018 10:46:31 +0800 Subject: [PATCH] test: add doc for testing gorush --- tests/README.md | 34 ++++++++++++++++++++++++++++++++++ tests/test.json | 14 ++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 tests/README.md create mode 100644 tests/test.json diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..a892854 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,34 @@ +# Testing + +How to test gorush with http request? + +## download bat tool + +Download [cURL-like tool for humans](https://github.com/astaxie/bat). + +## testing + +see the JSON format: + +```json +{ + "notifications": [ + { + "tokens": ["token_a", "token_b"], + "platform": 1, + "message": "Hello World iOS!" + }, + { + "tokens": ["token_a", "token_b"], + "platform": 2, + "message": "Hello World Android!" + } + ] +} +``` + +run the following command. + +```sh +$ bat POST localhost:8088/api/push < tests/test.json +``` diff --git a/tests/test.json b/tests/test.json new file mode 100644 index 0000000..90a28e0 --- /dev/null +++ b/tests/test.json @@ -0,0 +1,14 @@ +{ + "notifications": [ + { + "tokens": ["token_a", "token_b"], + "platform": 1, + "message": "Hello World iOS!" + }, + { + "tokens": ["token_a", "token_b"], + "platform": 2, + "message": "Hello World Android!" + } + ] +}