@@ -2,69 +2,90 @@ var server = require('./support/server');
22var Client = require ( '../lib/Client' ) ;
33
44var requests = {
5- '/fake' : {
5+ 'GET /fake' : {
66 status : 200 ,
77 body : { message : 'OK' }
88 } ,
99
10- '/fake?per_page=20&page=10' : {
10+ 'GET /fake?per_page=20&page=10' : {
1111 status : 200 ,
1212 body : { message : 'ALRIGHT' }
1313 } ,
1414
15- '/201' : {
15+ 'POST /201' : {
1616 status : 201 ,
1717 body : { ok : true }
1818 } ,
1919
20- '/204' : {
20+ 'PUT /204' : {
2121 status : 204 ,
2222 body : null
2323 } ,
2424
25- '/401' : {
25+ 'GET /401' : {
2626 status : 401 ,
2727 body : null
2828 } ,
2929
30- '/metrics' : {
30+ 'GET /metrics' : {
3131 status : 200 ,
3232 body : { nps : 0 }
3333 } ,
3434
35- '/metrics?since=1424359740' : {
35+ 'GET /metrics?since=1424359740' : {
3636 status : 200 ,
3737 body : { nps : 10 }
3838 } ,
3939
40- '/people' : {
40+ 'POST /people' : {
4141 status : 201 ,
4242 body : { email : 'foo@example.com' }
4343 } ,
4444
45- '/people/foo%40example.com/survey_requests/pending' : {
45+ 'PUT /people' : {
46+ status : 201 ,
47+ body : { email : 'foo@example.com' }
48+ } ,
49+
50+ 'DELETE /people/foo%40example.com/survey_requests/pending' : {
4651 status : 200 ,
4752 body : { ok : true }
4853 } ,
4954
50- '/survey_responses' : {
55+ 'POST /survey_responses' : {
5156 status : 201 ,
5257 body : { person : '321' }
5358 } ,
5459
55- '/survey_responses/321' : {
60+ 'GET /survey_responses/321' : {
5661 status : 200 ,
5762 body : { person : '321' }
5863 } ,
5964
60- '/survey_responses?order=desc' : {
65+ 'GET /survey_responses?order=desc' : {
6166 status : 200 ,
6267 body : [ { id : 1 } , { id : 2 } ]
6368 } ,
6469
65- '/unsubscribes' : {
70+ 'POST /unsubscribes' : {
6671 status : 201 ,
6772 body : { person_email : 'foo@example.com' }
73+ } ,
74+
75+ 'GET /unsubscribes' : {
76+ status : 200 ,
77+ body : [
78+ { person_id : '475' , email : 'foo@example.com' , name : 'Foo' , unsubscribed_at : 1440621400 } ,
79+ { person_id : '634' , email : 'bar@example.com' , name : 'Bar' , unsubscribed_at : 1440621453 }
80+ ]
81+ } ,
82+
83+ 'GET /bounces' : {
84+ status : 200 ,
85+ body : [
86+ { person_id : '475' , email : 'foo@example.com' , name : 'Foo' , bounced_at : 1440621400 } ,
87+ { person_id : '634' , email : 'bar@example.com' , name : 'Bar' , bounced_at : 1440621453 }
88+ ]
6889 }
6990} ;
7091
0 commit comments