poptart 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/lib/poptart.rb +1 -4
  4. data/lib/poptart/link.rb +9 -0
  5. data/lib/poptart/model.rb +13 -29
  6. data/lib/poptart/question.rb +21 -17
  7. data/lib/poptart/root.rb +10 -1
  8. data/lib/poptart/survey.rb +34 -7
  9. data/lib/poptart/survey_question.rb +32 -12
  10. data/lib/poptart/user.rb +4 -21
  11. data/lib/version.rb +1 -1
  12. data/poptart.gemspec +0 -4
  13. data/spec/lib/poptart/model_spec.rb +95 -0
  14. data/spec/lib/poptart/question_spec.rb +47 -0
  15. data/spec/lib/poptart/root_spec.rb +50 -0
  16. data/spec/lib/poptart/survey_question_spec.rb +166 -0
  17. data/spec/lib/poptart/survey_spec.rb +105 -0
  18. data/spec/lib/poptart/user_spec.rb +45 -0
  19. data/spec/requests/questions_spec.rb +31 -0
  20. data/spec/requests/survey_questions_spec.rb +150 -0
  21. data/spec/requests/surveys_spec.rb +34 -5
  22. data/spec/requests/{user_management_spec.rb → users_spec.rb} +5 -5
  23. data/spec/spec_helper.rb +1 -4
  24. data/spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml +1527 -1596
  25. data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +2942 -2035
  26. data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +254 -70
  27. data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +110 -48
  28. data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +1618 -286
  29. data/spec/vcr/poptart/survey/adds_a_question_to_a_survey.yml +1939 -0
  30. data/spec/vcr/poptart/survey/creates_a_random_survey.yml +318 -0
  31. data/spec/vcr/poptart/survey/creates_an_empty_survey.yml +702 -0
  32. data/spec/vcr/poptart/survey/returns_a_survey_by_id.yml +618 -0
  33. data/spec/vcr/poptart/user/creates_a_user.yml +179 -0
  34. data/spec/vcr/{user/management_creates_a_user.yml → poptart/user/returns_a_user.yml} +72 -69
  35. data/spec/vcr/questions/creates_a_question.yml +186 -0
  36. data/spec/vcr/questions/finds_a_question_by_id.yml +326 -0
  37. data/spec/vcr/questions/finds_a_question_by_key.yml +144 -0
  38. data/spec/vcr/questions/returns_all_answered_survey_questions_for_a_question.yml +1021 -0
  39. data/spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml +533 -479
  40. data/spec/vcr/survey/questions_answers_a_multiple_choice_question.yml +1454 -0
  41. data/spec/vcr/survey/questions_answers_a_survey_question.yml +1772 -0
  42. data/spec/vcr/survey/questions_creates_and_returns_an_empty_survey.yml +372 -0
  43. data/spec/vcr/survey/questions_finds_survey_question_for_id.yml +3083 -0
  44. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question.yml +5756 -0
  45. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question_by_key.yml +973 -0
  46. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_survey.yml +620 -0
  47. metadata +55 -72
  48. data/lib/poptart/boolean_question.rb +0 -14
  49. data/lib/poptart/multiple_response_question.rb +0 -9
  50. data/lib/poptart/range_question.rb +0 -9
  51. data/lib/poptart/time_question.rb +0 -9
  52. data/spec/requests/answering_survey_questions_spec.rb +0 -79
  53. data/spec/requests/answers_spec.rb +0 -45
  54. data/spec/requests/creating_questions_spec.rb +0 -30
@@ -0,0 +1,1772 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/surveys/63/survey_questions
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"survey_question":{"question_id":67,"responses":null}}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/json
14
+ Api-Token:
15
+ - testing
16
+ User-Token:
17
+ - ef3dd911c4fa9b1810cb0eebdbda120bca81a251129b1f019e9ccd959fbc3317
18
+ Service-User-Id:
19
+ - 47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Accept:
23
+ - "*/*"
24
+ response:
25
+ status:
26
+ code: 201
27
+ message: 'Created '
28
+ headers:
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Ua-Compatible:
36
+ - chrome=1
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Etag:
40
+ - '"0d4224a3091346888c66169e81b46bb4"'
41
+ Cache-Control:
42
+ - max-age=0, private, must-revalidate
43
+ X-Request-Id:
44
+ - b1ee2da7-ce41-4db1-9cf9-8a1f958c4a78
45
+ X-Runtime:
46
+ - '0.018636'
47
+ Server:
48
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
49
+ Date:
50
+ - Sun, 18 Jan 2015 15:31:27 GMT
51
+ Content-Length:
52
+ - '497'
53
+ Connection:
54
+ - Keep-Alive
55
+ body:
56
+ encoding: UTF-8
57
+ string: |-
58
+ {
59
+ "id": 23,
60
+ "text": "Do you like poptarts?",
61
+ "question_type": "boolean",
62
+ "responses": [
63
+ "t",
64
+ "f"
65
+ ],
66
+ "answer": null,
67
+ "_links": {
68
+ "self": {
69
+ "href": "http://localhost:3000/api/surveys/63/survey_questions/23"
70
+ },
71
+ "put": {
72
+ "href": "http://localhost:3000/api/surveys/63/survey_questions/23"
73
+ },
74
+ "survey": {
75
+ "href": "http://localhost:3000/api/surveys/63"
76
+ }
77
+ },
78
+ "created_at": "2015-01-18T15:31:27.586Z",
79
+ "key": null,
80
+ "question_id": 67
81
+ }
82
+ http_version:
83
+ recorded_at: Sun, 18 Jan 2015 15:31:27 GMT
84
+ - request:
85
+ method: put
86
+ uri: http://localhost:3000/api/surveys/63/survey_questions/23
87
+ body:
88
+ encoding: UTF-8
89
+ string: '{"id":23,"survey_question":{"answer":true}}'
90
+ headers:
91
+ User-Agent:
92
+ - Faraday v0.9.0
93
+ Content-Type:
94
+ - application/json
95
+ Api-Token:
96
+ - testing
97
+ User-Token:
98
+ - ef3dd911c4fa9b1810cb0eebdbda120bca81a251129b1f019e9ccd959fbc3317
99
+ Service-User-Id:
100
+ - 47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64
101
+ Accept-Encoding:
102
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
103
+ Accept:
104
+ - "*/*"
105
+ response:
106
+ status:
107
+ code: 204
108
+ message: 'No Content '
109
+ headers:
110
+ X-Frame-Options:
111
+ - SAMEORIGIN
112
+ X-Xss-Protection:
113
+ - 1; mode=block
114
+ X-Content-Type-Options:
115
+ - nosniff
116
+ X-Ua-Compatible:
117
+ - chrome=1
118
+ Cache-Control:
119
+ - no-cache
120
+ X-Request-Id:
121
+ - 8ccc2328-23a8-4801-b99a-c22e2c665a06
122
+ X-Runtime:
123
+ - '0.021630'
124
+ Server:
125
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
126
+ Date:
127
+ - Sun, 18 Jan 2015 15:31:27 GMT
128
+ Connection:
129
+ - Keep-Alive
130
+ body:
131
+ encoding: UTF-8
132
+ string: ''
133
+ http_version:
134
+ recorded_at: Sun, 18 Jan 2015 15:31:27 GMT
135
+ - request:
136
+ method: get
137
+ uri: http://localhost:3000/api/surveys/63
138
+ body:
139
+ encoding: US-ASCII
140
+ string: ''
141
+ headers:
142
+ User-Agent:
143
+ - Faraday v0.9.0
144
+ Content-Type:
145
+ - application/json
146
+ Api-Token:
147
+ - testing
148
+ User-Token:
149
+ - ef3dd911c4fa9b1810cb0eebdbda120bca81a251129b1f019e9ccd959fbc3317
150
+ Service-User-Id:
151
+ - 47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64
152
+ Accept-Encoding:
153
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
154
+ Accept:
155
+ - "*/*"
156
+ response:
157
+ status:
158
+ code: 200
159
+ message: 'OK '
160
+ headers:
161
+ X-Frame-Options:
162
+ - SAMEORIGIN
163
+ X-Xss-Protection:
164
+ - 1; mode=block
165
+ X-Content-Type-Options:
166
+ - nosniff
167
+ X-Ua-Compatible:
168
+ - chrome=1
169
+ Content-Type:
170
+ - application/json; charset=utf-8
171
+ Etag:
172
+ - '"93b93d73464db0b26bc8c122a0010e52"'
173
+ Cache-Control:
174
+ - max-age=0, private, must-revalidate
175
+ X-Request-Id:
176
+ - dd1e4159-9143-498f-9657-b2760ae0f177
177
+ X-Runtime:
178
+ - '0.020431'
179
+ Server:
180
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
181
+ Date:
182
+ - Sun, 18 Jan 2015 15:31:27 GMT
183
+ Content-Length:
184
+ - '1063'
185
+ Connection:
186
+ - Keep-Alive
187
+ body:
188
+ encoding: UTF-8
189
+ string: |-
190
+ {
191
+ "id": 63,
192
+ "service_user_id": "47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64",
193
+ "_links": {
194
+ "self": {
195
+ "href": "http://localhost:3000/api/surveys/63"
196
+ },
197
+ "survey_questions": {
198
+ "post": {
199
+ "href": "http://localhost:3000/api/surveys/63/survey_questions"
200
+ },
201
+ "put": {
202
+ "href": "http://localhost:3000/api/surveys/63/survey_questions"
203
+ }
204
+ }
205
+ },
206
+ "completed": true,
207
+ "survey_questions": [
208
+ {
209
+ "id": 23,
210
+ "text": "Do you like poptarts?",
211
+ "question_type": "boolean",
212
+ "responses": [
213
+ "t",
214
+ "f"
215
+ ],
216
+ "answer": "t",
217
+ "_links": {
218
+ "self": {
219
+ "href": "http://localhost:3000/api/surveys/63/survey_questions/23"
220
+ },
221
+ "put": {
222
+ "href": "http://localhost:3000/api/surveys/63/survey_questions/23"
223
+ },
224
+ "survey": {
225
+ "href": "http://localhost:3000/api/surveys/63"
226
+ }
227
+ },
228
+ "created_at": "2015-01-18T15:31:27.586Z",
229
+ "key": null,
230
+ "question_id": 67
231
+ }
232
+ ]
233
+ }
234
+ http_version:
235
+ recorded_at: Sun, 18 Jan 2015 15:31:27 GMT
236
+ - request:
237
+ method: post
238
+ uri: http://localhost:3000/api/surveys/88/survey_questions
239
+ body:
240
+ encoding: UTF-8
241
+ string: '{"survey_question":{"question_id":86,"responses":null}}'
242
+ headers:
243
+ User-Agent:
244
+ - Faraday v0.9.0
245
+ Content-Type:
246
+ - application/json
247
+ Api-Token:
248
+ - testing
249
+ User-Token:
250
+ - 9d7f600d585aac42486498cb55ca867c6feba26682a2052158c66a69405097f4
251
+ Service-User-Id:
252
+ - fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880
253
+ Accept-Encoding:
254
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
255
+ Accept:
256
+ - "*/*"
257
+ response:
258
+ status:
259
+ code: 201
260
+ message: 'Created '
261
+ headers:
262
+ X-Frame-Options:
263
+ - SAMEORIGIN
264
+ X-Xss-Protection:
265
+ - 1; mode=block
266
+ X-Content-Type-Options:
267
+ - nosniff
268
+ X-Ua-Compatible:
269
+ - chrome=1
270
+ Content-Type:
271
+ - application/json; charset=utf-8
272
+ Etag:
273
+ - '"c99eaefcfcf41f23429adf0e0b74ba32"'
274
+ Cache-Control:
275
+ - max-age=0, private, must-revalidate
276
+ X-Request-Id:
277
+ - e02e1053-d3da-4aa4-8c16-cc6ee5a51da6
278
+ X-Runtime:
279
+ - '0.034324'
280
+ Server:
281
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
282
+ Date:
283
+ - Sun, 25 Jan 2015 14:00:57 GMT
284
+ Content-Length:
285
+ - '606'
286
+ Connection:
287
+ - Keep-Alive
288
+ body:
289
+ encoding: UTF-8
290
+ string: |-
291
+ {
292
+ "id": 40,
293
+ "text": "Do you like poptarts?",
294
+ "question_type": "boolean",
295
+ "responses": [
296
+ "t",
297
+ "f"
298
+ ],
299
+ "answer": null,
300
+ "_links": [
301
+ {
302
+ "rel": "self",
303
+ "href": "http://localhost:3000/api/surveys/88/survey_questions/40",
304
+ "method": "GET"
305
+ },
306
+ {
307
+ "rel": "self",
308
+ "href": "http://localhost:3000/api/surveys/88/survey_questions/40",
309
+ "method": "PUT"
310
+ },
311
+ {
312
+ "rel": "survey",
313
+ "href": "http://localhost:3000/api/surveys/88",
314
+ "method": "GET"
315
+ }
316
+ ],
317
+ "created_at": "2015-01-25T14:00:57.807Z",
318
+ "key": null,
319
+ "question_id": 86
320
+ }
321
+ http_version:
322
+ recorded_at: Sun, 25 Jan 2015 14:00:57 GMT
323
+ - request:
324
+ method: put
325
+ uri: http://localhost:3000/api/surveys/88/survey_questions/40
326
+ body:
327
+ encoding: UTF-8
328
+ string: '{"id":40,"survey_question":{"answer":true}}'
329
+ headers:
330
+ User-Agent:
331
+ - Faraday v0.9.0
332
+ Content-Type:
333
+ - application/json
334
+ Api-Token:
335
+ - testing
336
+ User-Token:
337
+ - 9d7f600d585aac42486498cb55ca867c6feba26682a2052158c66a69405097f4
338
+ Service-User-Id:
339
+ - fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880
340
+ Accept-Encoding:
341
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
342
+ Accept:
343
+ - "*/*"
344
+ response:
345
+ status:
346
+ code: 204
347
+ message: 'No Content '
348
+ headers:
349
+ X-Frame-Options:
350
+ - SAMEORIGIN
351
+ X-Xss-Protection:
352
+ - 1; mode=block
353
+ X-Content-Type-Options:
354
+ - nosniff
355
+ X-Ua-Compatible:
356
+ - chrome=1
357
+ Cache-Control:
358
+ - no-cache
359
+ X-Request-Id:
360
+ - b45314a9-6785-49fc-aaf2-5bfc81f627eb
361
+ X-Runtime:
362
+ - '0.010848'
363
+ Server:
364
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
365
+ Date:
366
+ - Sun, 25 Jan 2015 14:00:57 GMT
367
+ Connection:
368
+ - Keep-Alive
369
+ body:
370
+ encoding: UTF-8
371
+ string: ''
372
+ http_version:
373
+ recorded_at: Sun, 25 Jan 2015 14:00:57 GMT
374
+ - request:
375
+ method: get
376
+ uri: http://localhost:3000/api/surveys/88
377
+ body:
378
+ encoding: US-ASCII
379
+ string: ''
380
+ headers:
381
+ User-Agent:
382
+ - Faraday v0.9.0
383
+ Content-Type:
384
+ - application/json
385
+ Api-Token:
386
+ - testing
387
+ User-Token:
388
+ - 9d7f600d585aac42486498cb55ca867c6feba26682a2052158c66a69405097f4
389
+ Service-User-Id:
390
+ - fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880
391
+ Accept-Encoding:
392
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
393
+ Accept:
394
+ - "*/*"
395
+ response:
396
+ status:
397
+ code: 200
398
+ message: 'OK '
399
+ headers:
400
+ X-Frame-Options:
401
+ - SAMEORIGIN
402
+ X-Xss-Protection:
403
+ - 1; mode=block
404
+ X-Content-Type-Options:
405
+ - nosniff
406
+ X-Ua-Compatible:
407
+ - chrome=1
408
+ Content-Type:
409
+ - application/json; charset=utf-8
410
+ Etag:
411
+ - '"3d56c51caa736a0ff6d9b10b2096e1a9"'
412
+ Cache-Control:
413
+ - max-age=0, private, must-revalidate
414
+ X-Request-Id:
415
+ - 7e878c26-976e-47c7-a2c5-6d00e8f3d4fd
416
+ X-Runtime:
417
+ - '0.015536'
418
+ Server:
419
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
420
+ Date:
421
+ - Sun, 25 Jan 2015 14:00:57 GMT
422
+ Content-Length:
423
+ - '1147'
424
+ Connection:
425
+ - Keep-Alive
426
+ body:
427
+ encoding: UTF-8
428
+ string: |-
429
+ {
430
+ "id": 88,
431
+ "service_user_id": "fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880",
432
+ "_links": [
433
+ {
434
+ "href": "http://localhost:3000/api/surveys/88",
435
+ "rel": "self",
436
+ "method": "GET"
437
+ },
438
+ {
439
+ "href": "http://localhost:3000/api/surveys/88/survey_questions",
440
+ "rel": "survey-questions",
441
+ "method": "POST"
442
+ }
443
+ ],
444
+ "completed": true,
445
+ "survey_questions": [
446
+ {
447
+ "id": 40,
448
+ "text": "Do you like poptarts?",
449
+ "question_type": "boolean",
450
+ "responses": [
451
+ "t",
452
+ "f"
453
+ ],
454
+ "answer": "t",
455
+ "_links": [
456
+ {
457
+ "rel": "self",
458
+ "href": "http://localhost:3000/api/surveys/88/survey_questions/40",
459
+ "method": "GET"
460
+ },
461
+ {
462
+ "rel": "self",
463
+ "href": "http://localhost:3000/api/surveys/88/survey_questions/40",
464
+ "method": "PUT"
465
+ },
466
+ {
467
+ "rel": "survey",
468
+ "href": "http://localhost:3000/api/surveys/88",
469
+ "method": "GET"
470
+ }
471
+ ],
472
+ "created_at": "2015-01-25T14:00:57.807Z",
473
+ "key": null,
474
+ "question_id": 86
475
+ }
476
+ ]
477
+ }
478
+ http_version:
479
+ recorded_at: Sun, 25 Jan 2015 14:00:57 GMT
480
+ - request:
481
+ method: post
482
+ uri: http://localhost:3000/api/surveys/92/survey_questions
483
+ body:
484
+ encoding: UTF-8
485
+ string: '{"survey_question":{"question_id":89,"responses":null}}'
486
+ headers:
487
+ User-Agent:
488
+ - Faraday v0.9.0
489
+ Content-Type:
490
+ - application/json
491
+ Api-Token:
492
+ - testing
493
+ User-Token:
494
+ - 6e5d819ecc0f62afa27627b589b88dda55831b11d6520260d5e7a34d5dc4800f
495
+ Service-User-Id:
496
+ - 5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a
497
+ Accept-Encoding:
498
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
499
+ Accept:
500
+ - "*/*"
501
+ response:
502
+ status:
503
+ code: 201
504
+ message: 'Created '
505
+ headers:
506
+ X-Frame-Options:
507
+ - SAMEORIGIN
508
+ X-Xss-Protection:
509
+ - 1; mode=block
510
+ X-Content-Type-Options:
511
+ - nosniff
512
+ X-Ua-Compatible:
513
+ - chrome=1
514
+ Content-Type:
515
+ - application/json; charset=utf-8
516
+ Etag:
517
+ - '"b9e7bbdc39b0516a50b0f617b46f83ee"'
518
+ Cache-Control:
519
+ - max-age=0, private, must-revalidate
520
+ X-Request-Id:
521
+ - bd97dea5-2bf5-414f-a6cd-aab124bb3c57
522
+ X-Runtime:
523
+ - '0.018194'
524
+ Server:
525
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
526
+ Date:
527
+ - Sun, 25 Jan 2015 14:01:33 GMT
528
+ Content-Length:
529
+ - '606'
530
+ Connection:
531
+ - Keep-Alive
532
+ body:
533
+ encoding: UTF-8
534
+ string: |-
535
+ {
536
+ "id": 44,
537
+ "text": "Do you like poptarts?",
538
+ "question_type": "boolean",
539
+ "responses": [
540
+ "t",
541
+ "f"
542
+ ],
543
+ "answer": null,
544
+ "_links": [
545
+ {
546
+ "rel": "self",
547
+ "href": "http://localhost:3000/api/surveys/92/survey_questions/44",
548
+ "method": "GET"
549
+ },
550
+ {
551
+ "rel": "self",
552
+ "href": "http://localhost:3000/api/surveys/92/survey_questions/44",
553
+ "method": "PUT"
554
+ },
555
+ {
556
+ "rel": "survey",
557
+ "href": "http://localhost:3000/api/surveys/92",
558
+ "method": "GET"
559
+ }
560
+ ],
561
+ "created_at": "2015-01-25T14:01:33.805Z",
562
+ "key": null,
563
+ "question_id": 89
564
+ }
565
+ http_version:
566
+ recorded_at: Sun, 25 Jan 2015 14:01:33 GMT
567
+ - request:
568
+ method: put
569
+ uri: http://localhost:3000/api/surveys/92/survey_questions/44
570
+ body:
571
+ encoding: UTF-8
572
+ string: '{"id":44,"survey_question":{"answer":true}}'
573
+ headers:
574
+ User-Agent:
575
+ - Faraday v0.9.0
576
+ Content-Type:
577
+ - application/json
578
+ Api-Token:
579
+ - testing
580
+ User-Token:
581
+ - 6e5d819ecc0f62afa27627b589b88dda55831b11d6520260d5e7a34d5dc4800f
582
+ Service-User-Id:
583
+ - 5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a
584
+ Accept-Encoding:
585
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
586
+ Accept:
587
+ - "*/*"
588
+ response:
589
+ status:
590
+ code: 204
591
+ message: 'No Content '
592
+ headers:
593
+ X-Frame-Options:
594
+ - SAMEORIGIN
595
+ X-Xss-Protection:
596
+ - 1; mode=block
597
+ X-Content-Type-Options:
598
+ - nosniff
599
+ X-Ua-Compatible:
600
+ - chrome=1
601
+ Cache-Control:
602
+ - no-cache
603
+ X-Request-Id:
604
+ - 31211d7e-8176-4eba-ab68-487e42fa79a3
605
+ X-Runtime:
606
+ - '0.010798'
607
+ Server:
608
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
609
+ Date:
610
+ - Sun, 25 Jan 2015 14:01:33 GMT
611
+ Connection:
612
+ - Keep-Alive
613
+ body:
614
+ encoding: UTF-8
615
+ string: ''
616
+ http_version:
617
+ recorded_at: Sun, 25 Jan 2015 14:01:33 GMT
618
+ - request:
619
+ method: get
620
+ uri: http://localhost:3000/api/surveys/92
621
+ body:
622
+ encoding: US-ASCII
623
+ string: ''
624
+ headers:
625
+ User-Agent:
626
+ - Faraday v0.9.0
627
+ Content-Type:
628
+ - application/json
629
+ Api-Token:
630
+ - testing
631
+ User-Token:
632
+ - 6e5d819ecc0f62afa27627b589b88dda55831b11d6520260d5e7a34d5dc4800f
633
+ Service-User-Id:
634
+ - 5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a
635
+ Accept-Encoding:
636
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
637
+ Accept:
638
+ - "*/*"
639
+ response:
640
+ status:
641
+ code: 200
642
+ message: 'OK '
643
+ headers:
644
+ X-Frame-Options:
645
+ - SAMEORIGIN
646
+ X-Xss-Protection:
647
+ - 1; mode=block
648
+ X-Content-Type-Options:
649
+ - nosniff
650
+ X-Ua-Compatible:
651
+ - chrome=1
652
+ Content-Type:
653
+ - application/json; charset=utf-8
654
+ Etag:
655
+ - '"9a243e72c1064eef0b9215e7a7398e81"'
656
+ Cache-Control:
657
+ - max-age=0, private, must-revalidate
658
+ X-Request-Id:
659
+ - 65bffc9f-7c3a-4bc9-a4d5-cc3b071d6b61
660
+ X-Runtime:
661
+ - '0.013426'
662
+ Server:
663
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
664
+ Date:
665
+ - Sun, 25 Jan 2015 14:01:33 GMT
666
+ Content-Length:
667
+ - '1147'
668
+ Connection:
669
+ - Keep-Alive
670
+ body:
671
+ encoding: UTF-8
672
+ string: |-
673
+ {
674
+ "id": 92,
675
+ "service_user_id": "5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a",
676
+ "_links": [
677
+ {
678
+ "href": "http://localhost:3000/api/surveys/92",
679
+ "rel": "self",
680
+ "method": "GET"
681
+ },
682
+ {
683
+ "href": "http://localhost:3000/api/surveys/92/survey_questions",
684
+ "rel": "survey-questions",
685
+ "method": "POST"
686
+ }
687
+ ],
688
+ "completed": true,
689
+ "survey_questions": [
690
+ {
691
+ "id": 44,
692
+ "text": "Do you like poptarts?",
693
+ "question_type": "boolean",
694
+ "responses": [
695
+ "t",
696
+ "f"
697
+ ],
698
+ "answer": "t",
699
+ "_links": [
700
+ {
701
+ "rel": "self",
702
+ "href": "http://localhost:3000/api/surveys/92/survey_questions/44",
703
+ "method": "GET"
704
+ },
705
+ {
706
+ "rel": "self",
707
+ "href": "http://localhost:3000/api/surveys/92/survey_questions/44",
708
+ "method": "PUT"
709
+ },
710
+ {
711
+ "rel": "survey",
712
+ "href": "http://localhost:3000/api/surveys/92",
713
+ "method": "GET"
714
+ }
715
+ ],
716
+ "created_at": "2015-01-25T14:01:33.805Z",
717
+ "key": null,
718
+ "question_id": 89
719
+ }
720
+ ]
721
+ }
722
+ http_version:
723
+ recorded_at: Sun, 25 Jan 2015 14:01:33 GMT
724
+ - request:
725
+ method: post
726
+ uri: http://localhost:3000/api/surveys/97/survey_questions
727
+ body:
728
+ encoding: UTF-8
729
+ string: '{"survey_question":{"question_id":93,"responses":null}}'
730
+ headers:
731
+ User-Agent:
732
+ - Faraday v0.9.0
733
+ Content-Type:
734
+ - application/json
735
+ Api-Token:
736
+ - testing
737
+ User-Token:
738
+ - 43ccb7a785debcea52cc3840a2649f67b90bc42b788b11f7de529506fd704f4f
739
+ Service-User-Id:
740
+ - d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108
741
+ Accept-Encoding:
742
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
743
+ Accept:
744
+ - "*/*"
745
+ response:
746
+ status:
747
+ code: 201
748
+ message: 'Created '
749
+ headers:
750
+ X-Frame-Options:
751
+ - SAMEORIGIN
752
+ X-Xss-Protection:
753
+ - 1; mode=block
754
+ X-Content-Type-Options:
755
+ - nosniff
756
+ X-Ua-Compatible:
757
+ - chrome=1
758
+ Content-Type:
759
+ - application/json; charset=utf-8
760
+ Etag:
761
+ - '"6e3b1f98e563c78f934fa8384fd7f676"'
762
+ Cache-Control:
763
+ - max-age=0, private, must-revalidate
764
+ X-Request-Id:
765
+ - 88851ab4-47f6-4d51-bbef-024f1a7deaf8
766
+ X-Runtime:
767
+ - '0.011892'
768
+ Server:
769
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
770
+ Date:
771
+ - Sun, 25 Jan 2015 14:04:00 GMT
772
+ Content-Length:
773
+ - '606'
774
+ Connection:
775
+ - Keep-Alive
776
+ body:
777
+ encoding: UTF-8
778
+ string: |-
779
+ {
780
+ "id": 50,
781
+ "text": "Do you like poptarts?",
782
+ "question_type": "boolean",
783
+ "responses": [
784
+ "t",
785
+ "f"
786
+ ],
787
+ "answer": null,
788
+ "_links": [
789
+ {
790
+ "rel": "self",
791
+ "href": "http://localhost:3000/api/surveys/97/survey_questions/50",
792
+ "method": "GET"
793
+ },
794
+ {
795
+ "rel": "self",
796
+ "href": "http://localhost:3000/api/surveys/97/survey_questions/50",
797
+ "method": "PUT"
798
+ },
799
+ {
800
+ "rel": "survey",
801
+ "href": "http://localhost:3000/api/surveys/97",
802
+ "method": "GET"
803
+ }
804
+ ],
805
+ "created_at": "2015-01-25T14:04:00.551Z",
806
+ "key": null,
807
+ "question_id": 93
808
+ }
809
+ http_version:
810
+ recorded_at: Sun, 25 Jan 2015 14:04:00 GMT
811
+ - request:
812
+ method: put
813
+ uri: http://localhost:3000/api/surveys/97/survey_questions/50
814
+ body:
815
+ encoding: UTF-8
816
+ string: '{"id":50,"survey_question":{"answer":true}}'
817
+ headers:
818
+ User-Agent:
819
+ - Faraday v0.9.0
820
+ Content-Type:
821
+ - application/json
822
+ Api-Token:
823
+ - testing
824
+ User-Token:
825
+ - 43ccb7a785debcea52cc3840a2649f67b90bc42b788b11f7de529506fd704f4f
826
+ Service-User-Id:
827
+ - d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108
828
+ Accept-Encoding:
829
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
830
+ Accept:
831
+ - "*/*"
832
+ response:
833
+ status:
834
+ code: 204
835
+ message: 'No Content '
836
+ headers:
837
+ X-Frame-Options:
838
+ - SAMEORIGIN
839
+ X-Xss-Protection:
840
+ - 1; mode=block
841
+ X-Content-Type-Options:
842
+ - nosniff
843
+ X-Ua-Compatible:
844
+ - chrome=1
845
+ Cache-Control:
846
+ - no-cache
847
+ X-Request-Id:
848
+ - 73865372-4d8a-45af-bc56-6dbd6e592315
849
+ X-Runtime:
850
+ - '0.011063'
851
+ Server:
852
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
853
+ Date:
854
+ - Sun, 25 Jan 2015 14:04:00 GMT
855
+ Connection:
856
+ - Keep-Alive
857
+ body:
858
+ encoding: UTF-8
859
+ string: ''
860
+ http_version:
861
+ recorded_at: Sun, 25 Jan 2015 14:04:00 GMT
862
+ - request:
863
+ method: get
864
+ uri: http://localhost:3000/api/surveys/97
865
+ body:
866
+ encoding: US-ASCII
867
+ string: ''
868
+ headers:
869
+ User-Agent:
870
+ - Faraday v0.9.0
871
+ Content-Type:
872
+ - application/json
873
+ Api-Token:
874
+ - testing
875
+ User-Token:
876
+ - 43ccb7a785debcea52cc3840a2649f67b90bc42b788b11f7de529506fd704f4f
877
+ Service-User-Id:
878
+ - d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108
879
+ Accept-Encoding:
880
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
881
+ Accept:
882
+ - "*/*"
883
+ response:
884
+ status:
885
+ code: 200
886
+ message: 'OK '
887
+ headers:
888
+ X-Frame-Options:
889
+ - SAMEORIGIN
890
+ X-Xss-Protection:
891
+ - 1; mode=block
892
+ X-Content-Type-Options:
893
+ - nosniff
894
+ X-Ua-Compatible:
895
+ - chrome=1
896
+ Content-Type:
897
+ - application/json; charset=utf-8
898
+ Etag:
899
+ - '"33bec6e73f9d3c05af79bd9d5f2ab48f"'
900
+ Cache-Control:
901
+ - max-age=0, private, must-revalidate
902
+ X-Request-Id:
903
+ - b3c0be5c-c003-456b-9178-9a87876cad4d
904
+ X-Runtime:
905
+ - '0.031569'
906
+ Server:
907
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
908
+ Date:
909
+ - Sun, 25 Jan 2015 14:04:00 GMT
910
+ Content-Length:
911
+ - '1147'
912
+ Connection:
913
+ - Keep-Alive
914
+ body:
915
+ encoding: UTF-8
916
+ string: |-
917
+ {
918
+ "id": 97,
919
+ "service_user_id": "d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108",
920
+ "_links": [
921
+ {
922
+ "href": "http://localhost:3000/api/surveys/97",
923
+ "rel": "self",
924
+ "method": "GET"
925
+ },
926
+ {
927
+ "href": "http://localhost:3000/api/surveys/97/survey_questions",
928
+ "rel": "survey-questions",
929
+ "method": "POST"
930
+ }
931
+ ],
932
+ "completed": true,
933
+ "survey_questions": [
934
+ {
935
+ "id": 50,
936
+ "text": "Do you like poptarts?",
937
+ "question_type": "boolean",
938
+ "responses": [
939
+ "t",
940
+ "f"
941
+ ],
942
+ "answer": "t",
943
+ "_links": [
944
+ {
945
+ "rel": "self",
946
+ "href": "http://localhost:3000/api/surveys/97/survey_questions/50",
947
+ "method": "GET"
948
+ },
949
+ {
950
+ "rel": "self",
951
+ "href": "http://localhost:3000/api/surveys/97/survey_questions/50",
952
+ "method": "PUT"
953
+ },
954
+ {
955
+ "rel": "survey",
956
+ "href": "http://localhost:3000/api/surveys/97",
957
+ "method": "GET"
958
+ }
959
+ ],
960
+ "created_at": "2015-01-25T14:04:00.551Z",
961
+ "key": null,
962
+ "question_id": 93
963
+ }
964
+ ]
965
+ }
966
+ http_version:
967
+ recorded_at: Sun, 25 Jan 2015 14:04:00 GMT
968
+ - request:
969
+ method: get
970
+ uri: http://localhost:3000/
971
+ body:
972
+ encoding: US-ASCII
973
+ string: ''
974
+ headers:
975
+ User-Agent:
976
+ - Faraday v0.9.0
977
+ Content-Type:
978
+ - application/json
979
+ Api-Token:
980
+ - testing
981
+ Accept-Encoding:
982
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
983
+ Accept:
984
+ - "*/*"
985
+ response:
986
+ status:
987
+ code: 200
988
+ message: 'OK '
989
+ headers:
990
+ X-Frame-Options:
991
+ - SAMEORIGIN
992
+ X-Xss-Protection:
993
+ - 1; mode=block
994
+ X-Content-Type-Options:
995
+ - nosniff
996
+ X-Ua-Compatible:
997
+ - chrome=1
998
+ Content-Type:
999
+ - application/json; charset=utf-8
1000
+ Etag:
1001
+ - '"3a543c1faf13608a2dcffc78fccf95fd"'
1002
+ Cache-Control:
1003
+ - max-age=0, private, must-revalidate
1004
+ X-Request-Id:
1005
+ - dcbaf24d-f332-4eb8-aa40-dec71d2adcca
1006
+ X-Runtime:
1007
+ - '0.010970'
1008
+ Server:
1009
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1010
+ Date:
1011
+ - Sun, 25 Jan 2015 14:07:15 GMT
1012
+ Content-Length:
1013
+ - '1469'
1014
+ Connection:
1015
+ - Keep-Alive
1016
+ body:
1017
+ encoding: UTF-8
1018
+ string: |-
1019
+ {
1020
+ "_links": [
1021
+ {
1022
+ "href": "http://localhost:3000/",
1023
+ "rel": "self",
1024
+ "method": "GET"
1025
+ },
1026
+ {
1027
+ "href": "http://localhost:3000/api/surveys{/id}{?query*}",
1028
+ "rel": "surveys",
1029
+ "method": "GET"
1030
+ },
1031
+ {
1032
+ "href": "http://localhost:3000/api/surveys",
1033
+ "rel": "surveys",
1034
+ "method": "POST"
1035
+ },
1036
+ {
1037
+ "href": "http://localhost:3000/api/user{/id}{?query*}",
1038
+ "rel": "users",
1039
+ "method": "GET"
1040
+ },
1041
+ {
1042
+ "href": "http://localhost:3000/api/user",
1043
+ "rel": "users",
1044
+ "method": "POST"
1045
+ },
1046
+ {
1047
+ "href": "http://localhost:3000/api/questions{/id}{?query*}",
1048
+ "rel": "questions",
1049
+ "method": "GET"
1050
+ },
1051
+ {
1052
+ "href": "http://localhost:3000/api/questions",
1053
+ "rel": "questions",
1054
+ "method": "POST"
1055
+ },
1056
+ {
1057
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
1058
+ "rel": "survey-questions",
1059
+ "method": "GET"
1060
+ },
1061
+ {
1062
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
1063
+ "rel": "survey-questions",
1064
+ "method": "POST"
1065
+ },
1066
+ {
1067
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
1068
+ "rel": "survey-questions",
1069
+ "method": "PUT"
1070
+ },
1071
+ {
1072
+ "href": "http://localhost:3000/api/questions/survey_questions{?query*}",
1073
+ "rel": "survey-questions-by-query",
1074
+ "method": "GET"
1075
+ }
1076
+ ]
1077
+ }
1078
+ http_version:
1079
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1080
+ - request:
1081
+ method: post
1082
+ uri: http://localhost:3000/api/user
1083
+ body:
1084
+ encoding: UTF-8
1085
+ string: "{}"
1086
+ headers:
1087
+ User-Agent:
1088
+ - Faraday v0.9.0
1089
+ Content-Type:
1090
+ - application/json
1091
+ Api-Token:
1092
+ - testing
1093
+ Accept-Encoding:
1094
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1095
+ Accept:
1096
+ - "*/*"
1097
+ response:
1098
+ status:
1099
+ code: 201
1100
+ message: 'Created '
1101
+ headers:
1102
+ X-Frame-Options:
1103
+ - SAMEORIGIN
1104
+ X-Xss-Protection:
1105
+ - 1; mode=block
1106
+ X-Content-Type-Options:
1107
+ - nosniff
1108
+ X-Ua-Compatible:
1109
+ - chrome=1
1110
+ Content-Type:
1111
+ - application/json; charset=utf-8
1112
+ Etag:
1113
+ - '"f9b80921d6c3040472bd0eeb44a4668e"'
1114
+ Cache-Control:
1115
+ - max-age=0, private, must-revalidate
1116
+ X-Request-Id:
1117
+ - 2fc292e8-2c52-445a-9ab7-6fa31a7dca20
1118
+ X-Runtime:
1119
+ - '0.006986'
1120
+ Server:
1121
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1122
+ Date:
1123
+ - Sun, 25 Jan 2015 14:07:15 GMT
1124
+ Content-Length:
1125
+ - '292'
1126
+ Connection:
1127
+ - Keep-Alive
1128
+ body:
1129
+ encoding: UTF-8
1130
+ string: |-
1131
+ {
1132
+ "service_user_id": "6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc",
1133
+ "_links": [
1134
+ {
1135
+ "href": "http://localhost:3000/api/user",
1136
+ "rel": "self",
1137
+ "method": "GET"
1138
+ }
1139
+ ],
1140
+ "token": "418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779"
1141
+ }
1142
+ http_version:
1143
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1144
+ - request:
1145
+ method: get
1146
+ uri: http://localhost:3000/
1147
+ body:
1148
+ encoding: US-ASCII
1149
+ string: ''
1150
+ headers:
1151
+ User-Agent:
1152
+ - Faraday v0.9.0
1153
+ Content-Type:
1154
+ - application/json
1155
+ Api-Token:
1156
+ - testing
1157
+ User-Token:
1158
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1159
+ Service-User-Id:
1160
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1161
+ Accept-Encoding:
1162
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1163
+ Accept:
1164
+ - "*/*"
1165
+ response:
1166
+ status:
1167
+ code: 200
1168
+ message: 'OK '
1169
+ headers:
1170
+ X-Frame-Options:
1171
+ - SAMEORIGIN
1172
+ X-Xss-Protection:
1173
+ - 1; mode=block
1174
+ X-Content-Type-Options:
1175
+ - nosniff
1176
+ X-Ua-Compatible:
1177
+ - chrome=1
1178
+ Content-Type:
1179
+ - application/json; charset=utf-8
1180
+ Etag:
1181
+ - '"3a543c1faf13608a2dcffc78fccf95fd"'
1182
+ Cache-Control:
1183
+ - max-age=0, private, must-revalidate
1184
+ X-Request-Id:
1185
+ - 70816705-b0fb-4276-8e4b-315ba1b7e51b
1186
+ X-Runtime:
1187
+ - '0.005628'
1188
+ Server:
1189
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1190
+ Date:
1191
+ - Sun, 25 Jan 2015 14:07:15 GMT
1192
+ Content-Length:
1193
+ - '1469'
1194
+ Connection:
1195
+ - Keep-Alive
1196
+ body:
1197
+ encoding: UTF-8
1198
+ string: |-
1199
+ {
1200
+ "_links": [
1201
+ {
1202
+ "href": "http://localhost:3000/",
1203
+ "rel": "self",
1204
+ "method": "GET"
1205
+ },
1206
+ {
1207
+ "href": "http://localhost:3000/api/surveys{/id}{?query*}",
1208
+ "rel": "surveys",
1209
+ "method": "GET"
1210
+ },
1211
+ {
1212
+ "href": "http://localhost:3000/api/surveys",
1213
+ "rel": "surveys",
1214
+ "method": "POST"
1215
+ },
1216
+ {
1217
+ "href": "http://localhost:3000/api/user{/id}{?query*}",
1218
+ "rel": "users",
1219
+ "method": "GET"
1220
+ },
1221
+ {
1222
+ "href": "http://localhost:3000/api/user",
1223
+ "rel": "users",
1224
+ "method": "POST"
1225
+ },
1226
+ {
1227
+ "href": "http://localhost:3000/api/questions{/id}{?query*}",
1228
+ "rel": "questions",
1229
+ "method": "GET"
1230
+ },
1231
+ {
1232
+ "href": "http://localhost:3000/api/questions",
1233
+ "rel": "questions",
1234
+ "method": "POST"
1235
+ },
1236
+ {
1237
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
1238
+ "rel": "survey-questions",
1239
+ "method": "GET"
1240
+ },
1241
+ {
1242
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
1243
+ "rel": "survey-questions",
1244
+ "method": "POST"
1245
+ },
1246
+ {
1247
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
1248
+ "rel": "survey-questions",
1249
+ "method": "PUT"
1250
+ },
1251
+ {
1252
+ "href": "http://localhost:3000/api/questions/survey_questions{?query*}",
1253
+ "rel": "survey-questions-by-query",
1254
+ "method": "GET"
1255
+ }
1256
+ ]
1257
+ }
1258
+ http_version:
1259
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1260
+ - request:
1261
+ method: post
1262
+ uri: http://localhost:3000/api/surveys
1263
+ body:
1264
+ encoding: UTF-8
1265
+ string: "{}"
1266
+ headers:
1267
+ User-Agent:
1268
+ - Faraday v0.9.0
1269
+ Content-Type:
1270
+ - application/json
1271
+ Api-Token:
1272
+ - testing
1273
+ User-Token:
1274
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1275
+ Service-User-Id:
1276
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1277
+ Accept-Encoding:
1278
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1279
+ Accept:
1280
+ - "*/*"
1281
+ response:
1282
+ status:
1283
+ code: 201
1284
+ message: 'Created '
1285
+ headers:
1286
+ X-Frame-Options:
1287
+ - SAMEORIGIN
1288
+ X-Xss-Protection:
1289
+ - 1; mode=block
1290
+ X-Content-Type-Options:
1291
+ - nosniff
1292
+ X-Ua-Compatible:
1293
+ - chrome=1
1294
+ Content-Type:
1295
+ - application/json; charset=utf-8
1296
+ Etag:
1297
+ - '"8d85854b13575e9f293611b51b9bebbe"'
1298
+ Cache-Control:
1299
+ - max-age=0, private, must-revalidate
1300
+ X-Request-Id:
1301
+ - 8d057d20-761c-405c-833e-1b4873b14337
1302
+ X-Runtime:
1303
+ - '0.021965'
1304
+ Server:
1305
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1306
+ Date:
1307
+ - Sun, 25 Jan 2015 14:07:15 GMT
1308
+ Content-Length:
1309
+ - '425'
1310
+ Connection:
1311
+ - Keep-Alive
1312
+ body:
1313
+ encoding: UTF-8
1314
+ string: |-
1315
+ {
1316
+ "id": 102,
1317
+ "service_user_id": "6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc",
1318
+ "_links": [
1319
+ {
1320
+ "href": "http://localhost:3000/api/surveys/102",
1321
+ "rel": "self",
1322
+ "method": "GET"
1323
+ },
1324
+ {
1325
+ "href": "http://localhost:3000/api/surveys/102/survey_questions",
1326
+ "rel": "survey-questions",
1327
+ "method": "POST"
1328
+ }
1329
+ ],
1330
+ "completed": true,
1331
+ "survey_questions": [
1332
+
1333
+ ]
1334
+ }
1335
+ http_version:
1336
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1337
+ - request:
1338
+ method: get
1339
+ uri: http://localhost:3000/
1340
+ body:
1341
+ encoding: US-ASCII
1342
+ string: ''
1343
+ headers:
1344
+ User-Agent:
1345
+ - Faraday v0.9.0
1346
+ Content-Type:
1347
+ - application/json
1348
+ Api-Token:
1349
+ - testing
1350
+ User-Token:
1351
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1352
+ Service-User-Id:
1353
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1354
+ Accept-Encoding:
1355
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1356
+ Accept:
1357
+ - "*/*"
1358
+ response:
1359
+ status:
1360
+ code: 200
1361
+ message: 'OK '
1362
+ headers:
1363
+ X-Frame-Options:
1364
+ - SAMEORIGIN
1365
+ X-Xss-Protection:
1366
+ - 1; mode=block
1367
+ X-Content-Type-Options:
1368
+ - nosniff
1369
+ X-Ua-Compatible:
1370
+ - chrome=1
1371
+ Content-Type:
1372
+ - application/json; charset=utf-8
1373
+ Etag:
1374
+ - '"3a543c1faf13608a2dcffc78fccf95fd"'
1375
+ Cache-Control:
1376
+ - max-age=0, private, must-revalidate
1377
+ X-Request-Id:
1378
+ - 6d5efdea-b7a3-4ca9-a12e-4ed9afe4622f
1379
+ X-Runtime:
1380
+ - '0.005738'
1381
+ Server:
1382
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1383
+ Date:
1384
+ - Sun, 25 Jan 2015 14:07:15 GMT
1385
+ Content-Length:
1386
+ - '1469'
1387
+ Connection:
1388
+ - Keep-Alive
1389
+ body:
1390
+ encoding: UTF-8
1391
+ string: |-
1392
+ {
1393
+ "_links": [
1394
+ {
1395
+ "href": "http://localhost:3000/",
1396
+ "rel": "self",
1397
+ "method": "GET"
1398
+ },
1399
+ {
1400
+ "href": "http://localhost:3000/api/surveys{/id}{?query*}",
1401
+ "rel": "surveys",
1402
+ "method": "GET"
1403
+ },
1404
+ {
1405
+ "href": "http://localhost:3000/api/surveys",
1406
+ "rel": "surveys",
1407
+ "method": "POST"
1408
+ },
1409
+ {
1410
+ "href": "http://localhost:3000/api/user{/id}{?query*}",
1411
+ "rel": "users",
1412
+ "method": "GET"
1413
+ },
1414
+ {
1415
+ "href": "http://localhost:3000/api/user",
1416
+ "rel": "users",
1417
+ "method": "POST"
1418
+ },
1419
+ {
1420
+ "href": "http://localhost:3000/api/questions{/id}{?query*}",
1421
+ "rel": "questions",
1422
+ "method": "GET"
1423
+ },
1424
+ {
1425
+ "href": "http://localhost:3000/api/questions",
1426
+ "rel": "questions",
1427
+ "method": "POST"
1428
+ },
1429
+ {
1430
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
1431
+ "rel": "survey-questions",
1432
+ "method": "GET"
1433
+ },
1434
+ {
1435
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
1436
+ "rel": "survey-questions",
1437
+ "method": "POST"
1438
+ },
1439
+ {
1440
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
1441
+ "rel": "survey-questions",
1442
+ "method": "PUT"
1443
+ },
1444
+ {
1445
+ "href": "http://localhost:3000/api/questions/survey_questions{?query*}",
1446
+ "rel": "survey-questions-by-query",
1447
+ "method": "GET"
1448
+ }
1449
+ ]
1450
+ }
1451
+ http_version:
1452
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1453
+ - request:
1454
+ method: post
1455
+ uri: http://localhost:3000/api/questions
1456
+ body:
1457
+ encoding: UTF-8
1458
+ string: '{"question":{"question_type":"boolean","responses":[true,false],"text":"Do
1459
+ you like poptarts?","key":null}}'
1460
+ headers:
1461
+ User-Agent:
1462
+ - Faraday v0.9.0
1463
+ Content-Type:
1464
+ - application/json
1465
+ Api-Token:
1466
+ - testing
1467
+ User-Token:
1468
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1469
+ Service-User-Id:
1470
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1471
+ Accept-Encoding:
1472
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1473
+ Accept:
1474
+ - "*/*"
1475
+ response:
1476
+ status:
1477
+ code: 201
1478
+ message: 'Created '
1479
+ headers:
1480
+ X-Frame-Options:
1481
+ - SAMEORIGIN
1482
+ X-Xss-Protection:
1483
+ - 1; mode=block
1484
+ X-Content-Type-Options:
1485
+ - nosniff
1486
+ X-Ua-Compatible:
1487
+ - chrome=1
1488
+ Content-Type:
1489
+ - application/json; charset=utf-8
1490
+ Etag:
1491
+ - '"b0c2d668f46c4277fc83cdd80172e212"'
1492
+ Cache-Control:
1493
+ - max-age=0, private, must-revalidate
1494
+ X-Request-Id:
1495
+ - 565ed9e7-105d-4de7-a9bd-28f833a6e421
1496
+ X-Runtime:
1497
+ - '0.007163'
1498
+ Server:
1499
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1500
+ Date:
1501
+ - Sun, 25 Jan 2015 14:07:15 GMT
1502
+ Content-Length:
1503
+ - '266'
1504
+ Connection:
1505
+ - Keep-Alive
1506
+ body:
1507
+ encoding: UTF-8
1508
+ string: |-
1509
+ {
1510
+ "id": 97,
1511
+ "question_type": "boolean",
1512
+ "text": "Do you like poptarts?",
1513
+ "responses": [
1514
+ true,
1515
+ false
1516
+ ],
1517
+ "key": null,
1518
+ "_links": [
1519
+ {
1520
+ "rel": "self",
1521
+ "href": "http://localhost:3000/api/questions/97",
1522
+ "method": "GET"
1523
+ }
1524
+ ]
1525
+ }
1526
+ http_version:
1527
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1528
+ - request:
1529
+ method: post
1530
+ uri: http://localhost:3000/api/surveys/102/survey_questions
1531
+ body:
1532
+ encoding: UTF-8
1533
+ string: '{"survey_question":{"question_id":97,"responses":null}}'
1534
+ headers:
1535
+ User-Agent:
1536
+ - Faraday v0.9.0
1537
+ Content-Type:
1538
+ - application/json
1539
+ Api-Token:
1540
+ - testing
1541
+ User-Token:
1542
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1543
+ Service-User-Id:
1544
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1545
+ Accept-Encoding:
1546
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1547
+ Accept:
1548
+ - "*/*"
1549
+ response:
1550
+ status:
1551
+ code: 201
1552
+ message: 'Created '
1553
+ headers:
1554
+ X-Frame-Options:
1555
+ - SAMEORIGIN
1556
+ X-Xss-Protection:
1557
+ - 1; mode=block
1558
+ X-Content-Type-Options:
1559
+ - nosniff
1560
+ X-Ua-Compatible:
1561
+ - chrome=1
1562
+ Content-Type:
1563
+ - application/json; charset=utf-8
1564
+ Etag:
1565
+ - '"d913552a9dd3438896ddeebdc99dd354"'
1566
+ Cache-Control:
1567
+ - max-age=0, private, must-revalidate
1568
+ X-Request-Id:
1569
+ - 7d5fefa8-a0d8-421c-ba34-170828769cc2
1570
+ X-Runtime:
1571
+ - '0.012621'
1572
+ Server:
1573
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1574
+ Date:
1575
+ - Sun, 25 Jan 2015 14:07:15 GMT
1576
+ Content-Length:
1577
+ - '609'
1578
+ Connection:
1579
+ - Keep-Alive
1580
+ body:
1581
+ encoding: UTF-8
1582
+ string: |-
1583
+ {
1584
+ "id": 56,
1585
+ "text": "Do you like poptarts?",
1586
+ "question_type": "boolean",
1587
+ "responses": [
1588
+ "t",
1589
+ "f"
1590
+ ],
1591
+ "answer": null,
1592
+ "_links": [
1593
+ {
1594
+ "rel": "self",
1595
+ "href": "http://localhost:3000/api/surveys/102/survey_questions/56",
1596
+ "method": "GET"
1597
+ },
1598
+ {
1599
+ "rel": "self",
1600
+ "href": "http://localhost:3000/api/surveys/102/survey_questions/56",
1601
+ "method": "PUT"
1602
+ },
1603
+ {
1604
+ "rel": "survey",
1605
+ "href": "http://localhost:3000/api/surveys/102",
1606
+ "method": "GET"
1607
+ }
1608
+ ],
1609
+ "created_at": "2015-01-25T14:07:15.142Z",
1610
+ "key": null,
1611
+ "question_id": 97
1612
+ }
1613
+ http_version:
1614
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1615
+ - request:
1616
+ method: put
1617
+ uri: http://localhost:3000/api/surveys/102/survey_questions/56
1618
+ body:
1619
+ encoding: UTF-8
1620
+ string: '{"id":56,"survey_question":{"answer":true}}'
1621
+ headers:
1622
+ User-Agent:
1623
+ - Faraday v0.9.0
1624
+ Content-Type:
1625
+ - application/json
1626
+ Api-Token:
1627
+ - testing
1628
+ User-Token:
1629
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1630
+ Service-User-Id:
1631
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1632
+ Accept-Encoding:
1633
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1634
+ Accept:
1635
+ - "*/*"
1636
+ response:
1637
+ status:
1638
+ code: 204
1639
+ message: 'No Content '
1640
+ headers:
1641
+ X-Frame-Options:
1642
+ - SAMEORIGIN
1643
+ X-Xss-Protection:
1644
+ - 1; mode=block
1645
+ X-Content-Type-Options:
1646
+ - nosniff
1647
+ X-Ua-Compatible:
1648
+ - chrome=1
1649
+ Cache-Control:
1650
+ - no-cache
1651
+ X-Request-Id:
1652
+ - 9b9f336b-0984-4f7f-a257-c87efcc61bab
1653
+ X-Runtime:
1654
+ - '0.011095'
1655
+ Server:
1656
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1657
+ Date:
1658
+ - Sun, 25 Jan 2015 14:07:15 GMT
1659
+ Connection:
1660
+ - Keep-Alive
1661
+ body:
1662
+ encoding: UTF-8
1663
+ string: ''
1664
+ http_version:
1665
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1666
+ - request:
1667
+ method: get
1668
+ uri: http://localhost:3000/api/surveys/102
1669
+ body:
1670
+ encoding: US-ASCII
1671
+ string: ''
1672
+ headers:
1673
+ User-Agent:
1674
+ - Faraday v0.9.0
1675
+ Content-Type:
1676
+ - application/json
1677
+ Api-Token:
1678
+ - testing
1679
+ User-Token:
1680
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1681
+ Service-User-Id:
1682
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1683
+ Accept-Encoding:
1684
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1685
+ Accept:
1686
+ - "*/*"
1687
+ response:
1688
+ status:
1689
+ code: 200
1690
+ message: 'OK '
1691
+ headers:
1692
+ X-Frame-Options:
1693
+ - SAMEORIGIN
1694
+ X-Xss-Protection:
1695
+ - 1; mode=block
1696
+ X-Content-Type-Options:
1697
+ - nosniff
1698
+ X-Ua-Compatible:
1699
+ - chrome=1
1700
+ Content-Type:
1701
+ - application/json; charset=utf-8
1702
+ Etag:
1703
+ - '"d152a734c03ccd35d3a77e446568d098"'
1704
+ Cache-Control:
1705
+ - max-age=0, private, must-revalidate
1706
+ X-Request-Id:
1707
+ - 4824f225-df29-4acb-8aa5-95063294ab72
1708
+ X-Runtime:
1709
+ - '0.015477'
1710
+ Server:
1711
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1712
+ Date:
1713
+ - Sun, 25 Jan 2015 14:07:15 GMT
1714
+ Content-Length:
1715
+ - '1153'
1716
+ Connection:
1717
+ - Keep-Alive
1718
+ body:
1719
+ encoding: UTF-8
1720
+ string: |-
1721
+ {
1722
+ "id": 102,
1723
+ "service_user_id": "6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc",
1724
+ "_links": [
1725
+ {
1726
+ "href": "http://localhost:3000/api/surveys/102",
1727
+ "rel": "self",
1728
+ "method": "GET"
1729
+ },
1730
+ {
1731
+ "href": "http://localhost:3000/api/surveys/102/survey_questions",
1732
+ "rel": "survey-questions",
1733
+ "method": "POST"
1734
+ }
1735
+ ],
1736
+ "completed": true,
1737
+ "survey_questions": [
1738
+ {
1739
+ "id": 56,
1740
+ "text": "Do you like poptarts?",
1741
+ "question_type": "boolean",
1742
+ "responses": [
1743
+ "t",
1744
+ "f"
1745
+ ],
1746
+ "answer": "t",
1747
+ "_links": [
1748
+ {
1749
+ "rel": "self",
1750
+ "href": "http://localhost:3000/api/surveys/102/survey_questions/56",
1751
+ "method": "GET"
1752
+ },
1753
+ {
1754
+ "rel": "self",
1755
+ "href": "http://localhost:3000/api/surveys/102/survey_questions/56",
1756
+ "method": "PUT"
1757
+ },
1758
+ {
1759
+ "rel": "survey",
1760
+ "href": "http://localhost:3000/api/surveys/102",
1761
+ "method": "GET"
1762
+ }
1763
+ ],
1764
+ "created_at": "2015-01-25T14:07:15.142Z",
1765
+ "key": null,
1766
+ "question_id": 97
1767
+ }
1768
+ ]
1769
+ }
1770
+ http_version:
1771
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1772
+ recorded_with: VCR 2.9.3