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,1454 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/surveys/64/survey_questions
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"survey_question":{"question_id":68,"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
+ - '"4e47bebafe06f1f2bed3300c6e59440b"'
41
+ Cache-Control:
42
+ - max-age=0, private, must-revalidate
43
+ X-Request-Id:
44
+ - 6fef15af-fbb6-4739-ace8-6ac49b9ad0c2
45
+ X-Runtime:
46
+ - '0.013496'
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
+ - '532'
53
+ Connection:
54
+ - Keep-Alive
55
+ body:
56
+ encoding: UTF-8
57
+ string: |-
58
+ {
59
+ "id": 24,
60
+ "text": "Where are you?",
61
+ "question_type": "multiple",
62
+ "responses": [
63
+ "At Home",
64
+ "At Work",
65
+ "In a car",
66
+ "Other"
67
+ ],
68
+ "answer": null,
69
+ "_links": {
70
+ "self": {
71
+ "href": "http://localhost:3000/api/surveys/64/survey_questions/24"
72
+ },
73
+ "put": {
74
+ "href": "http://localhost:3000/api/surveys/64/survey_questions/24"
75
+ },
76
+ "survey": {
77
+ "href": "http://localhost:3000/api/surveys/64"
78
+ }
79
+ },
80
+ "created_at": "2015-01-18T15:31:27.747Z",
81
+ "key": null,
82
+ "question_id": 68
83
+ }
84
+ http_version:
85
+ recorded_at: Sun, 18 Jan 2015 15:31:27 GMT
86
+ - request:
87
+ method: put
88
+ uri: http://localhost:3000/api/surveys/64/survey_questions/24
89
+ body:
90
+ encoding: UTF-8
91
+ string: '{"id":24,"survey_question":{"answer":"At Home"}}'
92
+ headers:
93
+ User-Agent:
94
+ - Faraday v0.9.0
95
+ Content-Type:
96
+ - application/json
97
+ Api-Token:
98
+ - testing
99
+ User-Token:
100
+ - ef3dd911c4fa9b1810cb0eebdbda120bca81a251129b1f019e9ccd959fbc3317
101
+ Service-User-Id:
102
+ - 47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64
103
+ Accept-Encoding:
104
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
105
+ Accept:
106
+ - "*/*"
107
+ response:
108
+ status:
109
+ code: 204
110
+ message: 'No Content '
111
+ headers:
112
+ X-Frame-Options:
113
+ - SAMEORIGIN
114
+ X-Xss-Protection:
115
+ - 1; mode=block
116
+ X-Content-Type-Options:
117
+ - nosniff
118
+ X-Ua-Compatible:
119
+ - chrome=1
120
+ Cache-Control:
121
+ - no-cache
122
+ X-Request-Id:
123
+ - a421f752-4f76-48a7-833a-5f5b526a8437
124
+ X-Runtime:
125
+ - '0.012488'
126
+ Server:
127
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
128
+ Date:
129
+ - Sun, 18 Jan 2015 15:31:27 GMT
130
+ Connection:
131
+ - Keep-Alive
132
+ body:
133
+ encoding: UTF-8
134
+ string: ''
135
+ http_version:
136
+ recorded_at: Sun, 18 Jan 2015 15:31:27 GMT
137
+ - request:
138
+ method: get
139
+ uri: http://localhost:3000/api/surveys/64
140
+ body:
141
+ encoding: US-ASCII
142
+ string: ''
143
+ headers:
144
+ User-Agent:
145
+ - Faraday v0.9.0
146
+ Content-Type:
147
+ - application/json
148
+ Api-Token:
149
+ - testing
150
+ User-Token:
151
+ - ef3dd911c4fa9b1810cb0eebdbda120bca81a251129b1f019e9ccd959fbc3317
152
+ Service-User-Id:
153
+ - 47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64
154
+ Accept-Encoding:
155
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
156
+ Accept:
157
+ - "*/*"
158
+ response:
159
+ status:
160
+ code: 200
161
+ message: 'OK '
162
+ headers:
163
+ X-Frame-Options:
164
+ - SAMEORIGIN
165
+ X-Xss-Protection:
166
+ - 1; mode=block
167
+ X-Content-Type-Options:
168
+ - nosniff
169
+ X-Ua-Compatible:
170
+ - chrome=1
171
+ Content-Type:
172
+ - application/json; charset=utf-8
173
+ Etag:
174
+ - '"b79ad1604e7283af7d494d969c835698"'
175
+ Cache-Control:
176
+ - max-age=0, private, must-revalidate
177
+ X-Request-Id:
178
+ - bcf761f7-0d6c-4fba-8e11-f09792f280ef
179
+ X-Runtime:
180
+ - '0.016303'
181
+ Server:
182
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
183
+ Date:
184
+ - Sun, 18 Jan 2015 15:31:27 GMT
185
+ Content-Length:
186
+ - '1112'
187
+ Connection:
188
+ - Keep-Alive
189
+ body:
190
+ encoding: UTF-8
191
+ string: |-
192
+ {
193
+ "id": 64,
194
+ "service_user_id": "47060b8cddb466302d2d21c7b8567902e8c6e1ba4e6dc9726a5e92b7826bdc64",
195
+ "_links": {
196
+ "self": {
197
+ "href": "http://localhost:3000/api/surveys/64"
198
+ },
199
+ "survey_questions": {
200
+ "post": {
201
+ "href": "http://localhost:3000/api/surveys/64/survey_questions"
202
+ },
203
+ "put": {
204
+ "href": "http://localhost:3000/api/surveys/64/survey_questions"
205
+ }
206
+ }
207
+ },
208
+ "completed": true,
209
+ "survey_questions": [
210
+ {
211
+ "id": 24,
212
+ "text": "Where are you?",
213
+ "question_type": "multiple",
214
+ "responses": [
215
+ "At Home",
216
+ "At Work",
217
+ "In a car",
218
+ "Other"
219
+ ],
220
+ "answer": "At Home",
221
+ "_links": {
222
+ "self": {
223
+ "href": "http://localhost:3000/api/surveys/64/survey_questions/24"
224
+ },
225
+ "put": {
226
+ "href": "http://localhost:3000/api/surveys/64/survey_questions/24"
227
+ },
228
+ "survey": {
229
+ "href": "http://localhost:3000/api/surveys/64"
230
+ }
231
+ },
232
+ "created_at": "2015-01-18T15:31:27.747Z",
233
+ "key": null,
234
+ "question_id": 68
235
+ }
236
+ ]
237
+ }
238
+ http_version:
239
+ recorded_at: Sun, 18 Jan 2015 15:31:27 GMT
240
+ - request:
241
+ method: post
242
+ uri: http://localhost:3000/api/surveys/89/survey_questions
243
+ body:
244
+ encoding: UTF-8
245
+ string: '{"survey_question":{"question_id":87,"responses":null}}'
246
+ headers:
247
+ User-Agent:
248
+ - Faraday v0.9.0
249
+ Content-Type:
250
+ - application/json
251
+ Api-Token:
252
+ - testing
253
+ User-Token:
254
+ - 9d7f600d585aac42486498cb55ca867c6feba26682a2052158c66a69405097f4
255
+ Service-User-Id:
256
+ - fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880
257
+ Accept-Encoding:
258
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
259
+ Accept:
260
+ - "*/*"
261
+ response:
262
+ status:
263
+ code: 201
264
+ message: 'Created '
265
+ headers:
266
+ X-Frame-Options:
267
+ - SAMEORIGIN
268
+ X-Xss-Protection:
269
+ - 1; mode=block
270
+ X-Content-Type-Options:
271
+ - nosniff
272
+ X-Ua-Compatible:
273
+ - chrome=1
274
+ Content-Type:
275
+ - application/json; charset=utf-8
276
+ Etag:
277
+ - '"c9aead3bf0552f27177619bb662bed31"'
278
+ Cache-Control:
279
+ - max-age=0, private, must-revalidate
280
+ X-Request-Id:
281
+ - 364f851d-f983-4c44-b40e-8bdecdfd7087
282
+ X-Runtime:
283
+ - '0.012386'
284
+ Server:
285
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
286
+ Date:
287
+ - Sun, 25 Jan 2015 14:00:57 GMT
288
+ Content-Length:
289
+ - '641'
290
+ Connection:
291
+ - Keep-Alive
292
+ body:
293
+ encoding: UTF-8
294
+ string: |-
295
+ {
296
+ "id": 41,
297
+ "text": "Where are you?",
298
+ "question_type": "multiple",
299
+ "responses": [
300
+ "At Home",
301
+ "At Work",
302
+ "In a car",
303
+ "Other"
304
+ ],
305
+ "answer": null,
306
+ "_links": [
307
+ {
308
+ "rel": "self",
309
+ "href": "http://localhost:3000/api/surveys/89/survey_questions/41",
310
+ "method": "GET"
311
+ },
312
+ {
313
+ "rel": "self",
314
+ "href": "http://localhost:3000/api/surveys/89/survey_questions/41",
315
+ "method": "PUT"
316
+ },
317
+ {
318
+ "rel": "survey",
319
+ "href": "http://localhost:3000/api/surveys/89",
320
+ "method": "GET"
321
+ }
322
+ ],
323
+ "created_at": "2015-01-25T14:00:57.965Z",
324
+ "key": null,
325
+ "question_id": 87
326
+ }
327
+ http_version:
328
+ recorded_at: Sun, 25 Jan 2015 14:00:57 GMT
329
+ - request:
330
+ method: put
331
+ uri: http://localhost:3000/api/surveys/89/survey_questions/41
332
+ body:
333
+ encoding: UTF-8
334
+ string: '{"id":41,"survey_question":{"answer":"At Home"}}'
335
+ headers:
336
+ User-Agent:
337
+ - Faraday v0.9.0
338
+ Content-Type:
339
+ - application/json
340
+ Api-Token:
341
+ - testing
342
+ User-Token:
343
+ - 9d7f600d585aac42486498cb55ca867c6feba26682a2052158c66a69405097f4
344
+ Service-User-Id:
345
+ - fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880
346
+ Accept-Encoding:
347
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
348
+ Accept:
349
+ - "*/*"
350
+ response:
351
+ status:
352
+ code: 204
353
+ message: 'No Content '
354
+ headers:
355
+ X-Frame-Options:
356
+ - SAMEORIGIN
357
+ X-Xss-Protection:
358
+ - 1; mode=block
359
+ X-Content-Type-Options:
360
+ - nosniff
361
+ X-Ua-Compatible:
362
+ - chrome=1
363
+ Cache-Control:
364
+ - no-cache
365
+ X-Request-Id:
366
+ - dcac6303-248e-461e-92dd-564a33799fa5
367
+ X-Runtime:
368
+ - '0.022145'
369
+ Server:
370
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
371
+ Date:
372
+ - Sun, 25 Jan 2015 14:00:57 GMT
373
+ Connection:
374
+ - Keep-Alive
375
+ body:
376
+ encoding: UTF-8
377
+ string: ''
378
+ http_version:
379
+ recorded_at: Sun, 25 Jan 2015 14:00:58 GMT
380
+ - request:
381
+ method: get
382
+ uri: http://localhost:3000/api/surveys/89
383
+ body:
384
+ encoding: US-ASCII
385
+ string: ''
386
+ headers:
387
+ User-Agent:
388
+ - Faraday v0.9.0
389
+ Content-Type:
390
+ - application/json
391
+ Api-Token:
392
+ - testing
393
+ User-Token:
394
+ - 9d7f600d585aac42486498cb55ca867c6feba26682a2052158c66a69405097f4
395
+ Service-User-Id:
396
+ - fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880
397
+ Accept-Encoding:
398
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
399
+ Accept:
400
+ - "*/*"
401
+ response:
402
+ status:
403
+ code: 200
404
+ message: 'OK '
405
+ headers:
406
+ X-Frame-Options:
407
+ - SAMEORIGIN
408
+ X-Xss-Protection:
409
+ - 1; mode=block
410
+ X-Content-Type-Options:
411
+ - nosniff
412
+ X-Ua-Compatible:
413
+ - chrome=1
414
+ Content-Type:
415
+ - application/json; charset=utf-8
416
+ Etag:
417
+ - '"d35f437390d8df5e5ffc77e1f7603674"'
418
+ Cache-Control:
419
+ - max-age=0, private, must-revalidate
420
+ X-Request-Id:
421
+ - c6397a31-125f-4afa-9480-691300b754b1
422
+ X-Runtime:
423
+ - '0.013038'
424
+ Server:
425
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
426
+ Date:
427
+ - Sun, 25 Jan 2015 14:00:58 GMT
428
+ Content-Length:
429
+ - '1196'
430
+ Connection:
431
+ - Keep-Alive
432
+ body:
433
+ encoding: UTF-8
434
+ string: |-
435
+ {
436
+ "id": 89,
437
+ "service_user_id": "fea4c5dc35488ac3e17ed02d96c04b83625d3399be26dcdcdf097e6316819880",
438
+ "_links": [
439
+ {
440
+ "href": "http://localhost:3000/api/surveys/89",
441
+ "rel": "self",
442
+ "method": "GET"
443
+ },
444
+ {
445
+ "href": "http://localhost:3000/api/surveys/89/survey_questions",
446
+ "rel": "survey-questions",
447
+ "method": "POST"
448
+ }
449
+ ],
450
+ "completed": true,
451
+ "survey_questions": [
452
+ {
453
+ "id": 41,
454
+ "text": "Where are you?",
455
+ "question_type": "multiple",
456
+ "responses": [
457
+ "At Home",
458
+ "At Work",
459
+ "In a car",
460
+ "Other"
461
+ ],
462
+ "answer": "At Home",
463
+ "_links": [
464
+ {
465
+ "rel": "self",
466
+ "href": "http://localhost:3000/api/surveys/89/survey_questions/41",
467
+ "method": "GET"
468
+ },
469
+ {
470
+ "rel": "self",
471
+ "href": "http://localhost:3000/api/surveys/89/survey_questions/41",
472
+ "method": "PUT"
473
+ },
474
+ {
475
+ "rel": "survey",
476
+ "href": "http://localhost:3000/api/surveys/89",
477
+ "method": "GET"
478
+ }
479
+ ],
480
+ "created_at": "2015-01-25T14:00:57.965Z",
481
+ "key": null,
482
+ "question_id": 87
483
+ }
484
+ ]
485
+ }
486
+ http_version:
487
+ recorded_at: Sun, 25 Jan 2015 14:00:58 GMT
488
+ - request:
489
+ method: post
490
+ uri: http://localhost:3000/api/surveys/93/survey_questions
491
+ body:
492
+ encoding: UTF-8
493
+ string: '{"survey_question":{"question_id":90,"responses":null}}'
494
+ headers:
495
+ User-Agent:
496
+ - Faraday v0.9.0
497
+ Content-Type:
498
+ - application/json
499
+ Api-Token:
500
+ - testing
501
+ User-Token:
502
+ - 6e5d819ecc0f62afa27627b589b88dda55831b11d6520260d5e7a34d5dc4800f
503
+ Service-User-Id:
504
+ - 5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a
505
+ Accept-Encoding:
506
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
507
+ Accept:
508
+ - "*/*"
509
+ response:
510
+ status:
511
+ code: 201
512
+ message: 'Created '
513
+ headers:
514
+ X-Frame-Options:
515
+ - SAMEORIGIN
516
+ X-Xss-Protection:
517
+ - 1; mode=block
518
+ X-Content-Type-Options:
519
+ - nosniff
520
+ X-Ua-Compatible:
521
+ - chrome=1
522
+ Content-Type:
523
+ - application/json; charset=utf-8
524
+ Etag:
525
+ - '"7838f84a5048d65eadb36f28cb002252"'
526
+ Cache-Control:
527
+ - max-age=0, private, must-revalidate
528
+ X-Request-Id:
529
+ - 02b33c4f-ce21-4f6a-809e-e6255694393a
530
+ X-Runtime:
531
+ - '0.012241'
532
+ Server:
533
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
534
+ Date:
535
+ - Sun, 25 Jan 2015 14:01:33 GMT
536
+ Content-Length:
537
+ - '641'
538
+ Connection:
539
+ - Keep-Alive
540
+ body:
541
+ encoding: UTF-8
542
+ string: |-
543
+ {
544
+ "id": 45,
545
+ "text": "Where are you?",
546
+ "question_type": "multiple",
547
+ "responses": [
548
+ "At Home",
549
+ "At Work",
550
+ "In a car",
551
+ "Other"
552
+ ],
553
+ "answer": null,
554
+ "_links": [
555
+ {
556
+ "rel": "self",
557
+ "href": "http://localhost:3000/api/surveys/93/survey_questions/45",
558
+ "method": "GET"
559
+ },
560
+ {
561
+ "rel": "self",
562
+ "href": "http://localhost:3000/api/surveys/93/survey_questions/45",
563
+ "method": "PUT"
564
+ },
565
+ {
566
+ "rel": "survey",
567
+ "href": "http://localhost:3000/api/surveys/93",
568
+ "method": "GET"
569
+ }
570
+ ],
571
+ "created_at": "2015-01-25T14:01:33.952Z",
572
+ "key": null,
573
+ "question_id": 90
574
+ }
575
+ http_version:
576
+ recorded_at: Sun, 25 Jan 2015 14:01:33 GMT
577
+ - request:
578
+ method: put
579
+ uri: http://localhost:3000/api/surveys/93/survey_questions/45
580
+ body:
581
+ encoding: UTF-8
582
+ string: '{"id":45,"survey_question":{"answer":"At Home"}}'
583
+ headers:
584
+ User-Agent:
585
+ - Faraday v0.9.0
586
+ Content-Type:
587
+ - application/json
588
+ Api-Token:
589
+ - testing
590
+ User-Token:
591
+ - 6e5d819ecc0f62afa27627b589b88dda55831b11d6520260d5e7a34d5dc4800f
592
+ Service-User-Id:
593
+ - 5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a
594
+ Accept-Encoding:
595
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
596
+ Accept:
597
+ - "*/*"
598
+ response:
599
+ status:
600
+ code: 204
601
+ message: 'No Content '
602
+ headers:
603
+ X-Frame-Options:
604
+ - SAMEORIGIN
605
+ X-Xss-Protection:
606
+ - 1; mode=block
607
+ X-Content-Type-Options:
608
+ - nosniff
609
+ X-Ua-Compatible:
610
+ - chrome=1
611
+ Cache-Control:
612
+ - no-cache
613
+ X-Request-Id:
614
+ - aa21069d-9b3e-4b27-b9fd-80d9b6962345
615
+ X-Runtime:
616
+ - '0.016918'
617
+ Server:
618
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
619
+ Date:
620
+ - Sun, 25 Jan 2015 14:01:33 GMT
621
+ Connection:
622
+ - Keep-Alive
623
+ body:
624
+ encoding: UTF-8
625
+ string: ''
626
+ http_version:
627
+ recorded_at: Sun, 25 Jan 2015 14:01:33 GMT
628
+ - request:
629
+ method: get
630
+ uri: http://localhost:3000/api/surveys/93
631
+ body:
632
+ encoding: US-ASCII
633
+ string: ''
634
+ headers:
635
+ User-Agent:
636
+ - Faraday v0.9.0
637
+ Content-Type:
638
+ - application/json
639
+ Api-Token:
640
+ - testing
641
+ User-Token:
642
+ - 6e5d819ecc0f62afa27627b589b88dda55831b11d6520260d5e7a34d5dc4800f
643
+ Service-User-Id:
644
+ - 5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a
645
+ Accept-Encoding:
646
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
647
+ Accept:
648
+ - "*/*"
649
+ response:
650
+ status:
651
+ code: 200
652
+ message: 'OK '
653
+ headers:
654
+ X-Frame-Options:
655
+ - SAMEORIGIN
656
+ X-Xss-Protection:
657
+ - 1; mode=block
658
+ X-Content-Type-Options:
659
+ - nosniff
660
+ X-Ua-Compatible:
661
+ - chrome=1
662
+ Content-Type:
663
+ - application/json; charset=utf-8
664
+ Etag:
665
+ - '"034698cabd531b1c0a20fa1a34a73753"'
666
+ Cache-Control:
667
+ - max-age=0, private, must-revalidate
668
+ X-Request-Id:
669
+ - 3a0d9639-7098-46fc-a0a8-ebeb8d789731
670
+ X-Runtime:
671
+ - '0.012938'
672
+ Server:
673
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
674
+ Date:
675
+ - Sun, 25 Jan 2015 14:01:34 GMT
676
+ Content-Length:
677
+ - '1196'
678
+ Connection:
679
+ - Keep-Alive
680
+ body:
681
+ encoding: UTF-8
682
+ string: |-
683
+ {
684
+ "id": 93,
685
+ "service_user_id": "5efbe883253ce66789f52f000572726bf0c3d0b67c38f43665f4053f9fbcd75a",
686
+ "_links": [
687
+ {
688
+ "href": "http://localhost:3000/api/surveys/93",
689
+ "rel": "self",
690
+ "method": "GET"
691
+ },
692
+ {
693
+ "href": "http://localhost:3000/api/surveys/93/survey_questions",
694
+ "rel": "survey-questions",
695
+ "method": "POST"
696
+ }
697
+ ],
698
+ "completed": true,
699
+ "survey_questions": [
700
+ {
701
+ "id": 45,
702
+ "text": "Where are you?",
703
+ "question_type": "multiple",
704
+ "responses": [
705
+ "At Home",
706
+ "At Work",
707
+ "In a car",
708
+ "Other"
709
+ ],
710
+ "answer": "At Home",
711
+ "_links": [
712
+ {
713
+ "rel": "self",
714
+ "href": "http://localhost:3000/api/surveys/93/survey_questions/45",
715
+ "method": "GET"
716
+ },
717
+ {
718
+ "rel": "self",
719
+ "href": "http://localhost:3000/api/surveys/93/survey_questions/45",
720
+ "method": "PUT"
721
+ },
722
+ {
723
+ "rel": "survey",
724
+ "href": "http://localhost:3000/api/surveys/93",
725
+ "method": "GET"
726
+ }
727
+ ],
728
+ "created_at": "2015-01-25T14:01:33.952Z",
729
+ "key": null,
730
+ "question_id": 90
731
+ }
732
+ ]
733
+ }
734
+ http_version:
735
+ recorded_at: Sun, 25 Jan 2015 14:01:34 GMT
736
+ - request:
737
+ method: post
738
+ uri: http://localhost:3000/api/surveys/98/survey_questions
739
+ body:
740
+ encoding: UTF-8
741
+ string: '{"survey_question":{"question_id":94,"responses":null}}'
742
+ headers:
743
+ User-Agent:
744
+ - Faraday v0.9.0
745
+ Content-Type:
746
+ - application/json
747
+ Api-Token:
748
+ - testing
749
+ User-Token:
750
+ - 43ccb7a785debcea52cc3840a2649f67b90bc42b788b11f7de529506fd704f4f
751
+ Service-User-Id:
752
+ - d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108
753
+ Accept-Encoding:
754
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
755
+ Accept:
756
+ - "*/*"
757
+ response:
758
+ status:
759
+ code: 201
760
+ message: 'Created '
761
+ headers:
762
+ X-Frame-Options:
763
+ - SAMEORIGIN
764
+ X-Xss-Protection:
765
+ - 1; mode=block
766
+ X-Content-Type-Options:
767
+ - nosniff
768
+ X-Ua-Compatible:
769
+ - chrome=1
770
+ Content-Type:
771
+ - application/json; charset=utf-8
772
+ Etag:
773
+ - '"d0e212c504c1c4f8578b2c7e05ed0a8e"'
774
+ Cache-Control:
775
+ - max-age=0, private, must-revalidate
776
+ X-Request-Id:
777
+ - a36d2f85-5d1a-4be4-867f-2f81bce2b6bf
778
+ X-Runtime:
779
+ - '0.012280'
780
+ Server:
781
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
782
+ Date:
783
+ - Sun, 25 Jan 2015 14:04:00 GMT
784
+ Content-Length:
785
+ - '641'
786
+ Connection:
787
+ - Keep-Alive
788
+ body:
789
+ encoding: UTF-8
790
+ string: |-
791
+ {
792
+ "id": 51,
793
+ "text": "Where are you?",
794
+ "question_type": "multiple",
795
+ "responses": [
796
+ "At Home",
797
+ "At Work",
798
+ "In a car",
799
+ "Other"
800
+ ],
801
+ "answer": null,
802
+ "_links": [
803
+ {
804
+ "rel": "self",
805
+ "href": "http://localhost:3000/api/surveys/98/survey_questions/51",
806
+ "method": "GET"
807
+ },
808
+ {
809
+ "rel": "self",
810
+ "href": "http://localhost:3000/api/surveys/98/survey_questions/51",
811
+ "method": "PUT"
812
+ },
813
+ {
814
+ "rel": "survey",
815
+ "href": "http://localhost:3000/api/surveys/98",
816
+ "method": "GET"
817
+ }
818
+ ],
819
+ "created_at": "2015-01-25T14:04:00.735Z",
820
+ "key": null,
821
+ "question_id": 94
822
+ }
823
+ http_version:
824
+ recorded_at: Sun, 25 Jan 2015 14:04:00 GMT
825
+ - request:
826
+ method: put
827
+ uri: http://localhost:3000/api/surveys/98/survey_questions/51
828
+ body:
829
+ encoding: UTF-8
830
+ string: '{"id":51,"survey_question":{"answer":"At Home"}}'
831
+ headers:
832
+ User-Agent:
833
+ - Faraday v0.9.0
834
+ Content-Type:
835
+ - application/json
836
+ Api-Token:
837
+ - testing
838
+ User-Token:
839
+ - 43ccb7a785debcea52cc3840a2649f67b90bc42b788b11f7de529506fd704f4f
840
+ Service-User-Id:
841
+ - d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108
842
+ Accept-Encoding:
843
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
844
+ Accept:
845
+ - "*/*"
846
+ response:
847
+ status:
848
+ code: 204
849
+ message: 'No Content '
850
+ headers:
851
+ X-Frame-Options:
852
+ - SAMEORIGIN
853
+ X-Xss-Protection:
854
+ - 1; mode=block
855
+ X-Content-Type-Options:
856
+ - nosniff
857
+ X-Ua-Compatible:
858
+ - chrome=1
859
+ Cache-Control:
860
+ - no-cache
861
+ X-Request-Id:
862
+ - ce763dfe-4020-4ebe-8640-7be13b9425b9
863
+ X-Runtime:
864
+ - '0.010941'
865
+ Server:
866
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
867
+ Date:
868
+ - Sun, 25 Jan 2015 14:04:00 GMT
869
+ Connection:
870
+ - Keep-Alive
871
+ body:
872
+ encoding: UTF-8
873
+ string: ''
874
+ http_version:
875
+ recorded_at: Sun, 25 Jan 2015 14:04:00 GMT
876
+ - request:
877
+ method: get
878
+ uri: http://localhost:3000/api/surveys/98
879
+ body:
880
+ encoding: US-ASCII
881
+ string: ''
882
+ headers:
883
+ User-Agent:
884
+ - Faraday v0.9.0
885
+ Content-Type:
886
+ - application/json
887
+ Api-Token:
888
+ - testing
889
+ User-Token:
890
+ - 43ccb7a785debcea52cc3840a2649f67b90bc42b788b11f7de529506fd704f4f
891
+ Service-User-Id:
892
+ - d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108
893
+ Accept-Encoding:
894
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
895
+ Accept:
896
+ - "*/*"
897
+ response:
898
+ status:
899
+ code: 200
900
+ message: 'OK '
901
+ headers:
902
+ X-Frame-Options:
903
+ - SAMEORIGIN
904
+ X-Xss-Protection:
905
+ - 1; mode=block
906
+ X-Content-Type-Options:
907
+ - nosniff
908
+ X-Ua-Compatible:
909
+ - chrome=1
910
+ Content-Type:
911
+ - application/json; charset=utf-8
912
+ Etag:
913
+ - '"82c49d603c5a1ee9ddde166c031e6de1"'
914
+ Cache-Control:
915
+ - max-age=0, private, must-revalidate
916
+ X-Request-Id:
917
+ - 59e625f8-0ee3-4ee0-87df-6c998b2c0180
918
+ X-Runtime:
919
+ - '0.015907'
920
+ Server:
921
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
922
+ Date:
923
+ - Sun, 25 Jan 2015 14:04:00 GMT
924
+ Content-Length:
925
+ - '1196'
926
+ Connection:
927
+ - Keep-Alive
928
+ body:
929
+ encoding: UTF-8
930
+ string: |-
931
+ {
932
+ "id": 98,
933
+ "service_user_id": "d93a796899cb899675bbb7e8253ef15aadcf15ca9377067c03cde66d0cec6108",
934
+ "_links": [
935
+ {
936
+ "href": "http://localhost:3000/api/surveys/98",
937
+ "rel": "self",
938
+ "method": "GET"
939
+ },
940
+ {
941
+ "href": "http://localhost:3000/api/surveys/98/survey_questions",
942
+ "rel": "survey-questions",
943
+ "method": "POST"
944
+ }
945
+ ],
946
+ "completed": true,
947
+ "survey_questions": [
948
+ {
949
+ "id": 51,
950
+ "text": "Where are you?",
951
+ "question_type": "multiple",
952
+ "responses": [
953
+ "At Home",
954
+ "At Work",
955
+ "In a car",
956
+ "Other"
957
+ ],
958
+ "answer": "At Home",
959
+ "_links": [
960
+ {
961
+ "rel": "self",
962
+ "href": "http://localhost:3000/api/surveys/98/survey_questions/51",
963
+ "method": "GET"
964
+ },
965
+ {
966
+ "rel": "self",
967
+ "href": "http://localhost:3000/api/surveys/98/survey_questions/51",
968
+ "method": "PUT"
969
+ },
970
+ {
971
+ "rel": "survey",
972
+ "href": "http://localhost:3000/api/surveys/98",
973
+ "method": "GET"
974
+ }
975
+ ],
976
+ "created_at": "2015-01-25T14:04:00.735Z",
977
+ "key": null,
978
+ "question_id": 94
979
+ }
980
+ ]
981
+ }
982
+ http_version:
983
+ recorded_at: Sun, 25 Jan 2015 14:04:00 GMT
984
+ - request:
985
+ method: post
986
+ uri: http://localhost:3000/api/user
987
+ body:
988
+ encoding: UTF-8
989
+ string: "{}"
990
+ headers:
991
+ User-Agent:
992
+ - Faraday v0.9.0
993
+ Content-Type:
994
+ - application/json
995
+ Api-Token:
996
+ - testing
997
+ User-Token:
998
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
999
+ Service-User-Id:
1000
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1001
+ Accept-Encoding:
1002
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1003
+ Accept:
1004
+ - "*/*"
1005
+ response:
1006
+ status:
1007
+ code: 201
1008
+ message: 'Created '
1009
+ headers:
1010
+ X-Frame-Options:
1011
+ - SAMEORIGIN
1012
+ X-Xss-Protection:
1013
+ - 1; mode=block
1014
+ X-Content-Type-Options:
1015
+ - nosniff
1016
+ X-Ua-Compatible:
1017
+ - chrome=1
1018
+ Content-Type:
1019
+ - application/json; charset=utf-8
1020
+ Etag:
1021
+ - '"f9b80921d6c3040472bd0eeb44a4668e"'
1022
+ Cache-Control:
1023
+ - max-age=0, private, must-revalidate
1024
+ X-Request-Id:
1025
+ - 7f2c3d10-7980-4837-8674-a14c80360fcd
1026
+ X-Runtime:
1027
+ - '0.007676'
1028
+ Server:
1029
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1030
+ Date:
1031
+ - Sun, 25 Jan 2015 14:07:15 GMT
1032
+ Content-Length:
1033
+ - '292'
1034
+ Connection:
1035
+ - Keep-Alive
1036
+ body:
1037
+ encoding: UTF-8
1038
+ string: |-
1039
+ {
1040
+ "service_user_id": "6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc",
1041
+ "_links": [
1042
+ {
1043
+ "href": "http://localhost:3000/api/user",
1044
+ "rel": "self",
1045
+ "method": "GET"
1046
+ }
1047
+ ],
1048
+ "token": "418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779"
1049
+ }
1050
+ http_version:
1051
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1052
+ - request:
1053
+ method: post
1054
+ uri: http://localhost:3000/api/surveys
1055
+ body:
1056
+ encoding: UTF-8
1057
+ string: "{}"
1058
+ headers:
1059
+ User-Agent:
1060
+ - Faraday v0.9.0
1061
+ Content-Type:
1062
+ - application/json
1063
+ Api-Token:
1064
+ - testing
1065
+ User-Token:
1066
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1067
+ Service-User-Id:
1068
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1069
+ Accept-Encoding:
1070
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1071
+ Accept:
1072
+ - "*/*"
1073
+ response:
1074
+ status:
1075
+ code: 201
1076
+ message: 'Created '
1077
+ headers:
1078
+ X-Frame-Options:
1079
+ - SAMEORIGIN
1080
+ X-Xss-Protection:
1081
+ - 1; mode=block
1082
+ X-Content-Type-Options:
1083
+ - nosniff
1084
+ X-Ua-Compatible:
1085
+ - chrome=1
1086
+ Content-Type:
1087
+ - application/json; charset=utf-8
1088
+ Etag:
1089
+ - '"775db2b72b6f657489a741bc2667c8e4"'
1090
+ Cache-Control:
1091
+ - max-age=0, private, must-revalidate
1092
+ X-Request-Id:
1093
+ - 7a1b689e-10c7-4bd5-b888-48c13d5467f2
1094
+ X-Runtime:
1095
+ - '0.010724'
1096
+ Server:
1097
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1098
+ Date:
1099
+ - Sun, 25 Jan 2015 14:07:15 GMT
1100
+ Content-Length:
1101
+ - '425'
1102
+ Connection:
1103
+ - Keep-Alive
1104
+ body:
1105
+ encoding: UTF-8
1106
+ string: |-
1107
+ {
1108
+ "id": 103,
1109
+ "service_user_id": "6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc",
1110
+ "_links": [
1111
+ {
1112
+ "href": "http://localhost:3000/api/surveys/103",
1113
+ "rel": "self",
1114
+ "method": "GET"
1115
+ },
1116
+ {
1117
+ "href": "http://localhost:3000/api/surveys/103/survey_questions",
1118
+ "rel": "survey-questions",
1119
+ "method": "POST"
1120
+ }
1121
+ ],
1122
+ "completed": true,
1123
+ "survey_questions": [
1124
+
1125
+ ]
1126
+ }
1127
+ http_version:
1128
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1129
+ - request:
1130
+ method: post
1131
+ uri: http://localhost:3000/api/questions
1132
+ body:
1133
+ encoding: UTF-8
1134
+ string: '{"question":{"question_type":"multiple","responses":["At Home","At
1135
+ Work","In a car","Other"],"text":"Where are you?","key":null}}'
1136
+ headers:
1137
+ User-Agent:
1138
+ - Faraday v0.9.0
1139
+ Content-Type:
1140
+ - application/json
1141
+ Api-Token:
1142
+ - testing
1143
+ User-Token:
1144
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1145
+ Service-User-Id:
1146
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1147
+ Accept-Encoding:
1148
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1149
+ Accept:
1150
+ - "*/*"
1151
+ response:
1152
+ status:
1153
+ code: 201
1154
+ message: 'Created '
1155
+ headers:
1156
+ X-Frame-Options:
1157
+ - SAMEORIGIN
1158
+ X-Xss-Protection:
1159
+ - 1; mode=block
1160
+ X-Content-Type-Options:
1161
+ - nosniff
1162
+ X-Ua-Compatible:
1163
+ - chrome=1
1164
+ Content-Type:
1165
+ - application/json; charset=utf-8
1166
+ Etag:
1167
+ - '"c76decb04627a81d836938c544897f3a"'
1168
+ Cache-Control:
1169
+ - max-age=0, private, must-revalidate
1170
+ X-Request-Id:
1171
+ - 6645a5b7-4930-4cd7-98d2-dd7567f40c37
1172
+ X-Runtime:
1173
+ - '0.007675'
1174
+ Server:
1175
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1176
+ Date:
1177
+ - Sun, 25 Jan 2015 14:07:15 GMT
1178
+ Content-Length:
1179
+ - '298'
1180
+ Connection:
1181
+ - Keep-Alive
1182
+ body:
1183
+ encoding: UTF-8
1184
+ string: |-
1185
+ {
1186
+ "id": 98,
1187
+ "question_type": "multiple",
1188
+ "text": "Where are you?",
1189
+ "responses": [
1190
+ "At Home",
1191
+ "At Work",
1192
+ "In a car",
1193
+ "Other"
1194
+ ],
1195
+ "key": null,
1196
+ "_links": [
1197
+ {
1198
+ "rel": "self",
1199
+ "href": "http://localhost:3000/api/questions/98",
1200
+ "method": "GET"
1201
+ }
1202
+ ]
1203
+ }
1204
+ http_version:
1205
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1206
+ - request:
1207
+ method: post
1208
+ uri: http://localhost:3000/api/surveys/103/survey_questions
1209
+ body:
1210
+ encoding: UTF-8
1211
+ string: '{"survey_question":{"question_id":98,"responses":null}}'
1212
+ headers:
1213
+ User-Agent:
1214
+ - Faraday v0.9.0
1215
+ Content-Type:
1216
+ - application/json
1217
+ Api-Token:
1218
+ - testing
1219
+ User-Token:
1220
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1221
+ Service-User-Id:
1222
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1223
+ Accept-Encoding:
1224
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1225
+ Accept:
1226
+ - "*/*"
1227
+ response:
1228
+ status:
1229
+ code: 201
1230
+ message: 'Created '
1231
+ headers:
1232
+ X-Frame-Options:
1233
+ - SAMEORIGIN
1234
+ X-Xss-Protection:
1235
+ - 1; mode=block
1236
+ X-Content-Type-Options:
1237
+ - nosniff
1238
+ X-Ua-Compatible:
1239
+ - chrome=1
1240
+ Content-Type:
1241
+ - application/json; charset=utf-8
1242
+ Etag:
1243
+ - '"c2f1cca7dfa315d53fe31f651853c357"'
1244
+ Cache-Control:
1245
+ - max-age=0, private, must-revalidate
1246
+ X-Request-Id:
1247
+ - ef3d6ff8-c07c-41d9-83ca-58be0a3920b4
1248
+ X-Runtime:
1249
+ - '0.012219'
1250
+ Server:
1251
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1252
+ Date:
1253
+ - Sun, 25 Jan 2015 14:07:15 GMT
1254
+ Content-Length:
1255
+ - '644'
1256
+ Connection:
1257
+ - Keep-Alive
1258
+ body:
1259
+ encoding: UTF-8
1260
+ string: |-
1261
+ {
1262
+ "id": 57,
1263
+ "text": "Where are you?",
1264
+ "question_type": "multiple",
1265
+ "responses": [
1266
+ "At Home",
1267
+ "At Work",
1268
+ "In a car",
1269
+ "Other"
1270
+ ],
1271
+ "answer": null,
1272
+ "_links": [
1273
+ {
1274
+ "rel": "self",
1275
+ "href": "http://localhost:3000/api/surveys/103/survey_questions/57",
1276
+ "method": "GET"
1277
+ },
1278
+ {
1279
+ "rel": "self",
1280
+ "href": "http://localhost:3000/api/surveys/103/survey_questions/57",
1281
+ "method": "PUT"
1282
+ },
1283
+ {
1284
+ "rel": "survey",
1285
+ "href": "http://localhost:3000/api/surveys/103",
1286
+ "method": "GET"
1287
+ }
1288
+ ],
1289
+ "created_at": "2015-01-25T14:07:15.309Z",
1290
+ "key": null,
1291
+ "question_id": 98
1292
+ }
1293
+ http_version:
1294
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1295
+ - request:
1296
+ method: put
1297
+ uri: http://localhost:3000/api/surveys/103/survey_questions/57
1298
+ body:
1299
+ encoding: UTF-8
1300
+ string: '{"id":57,"survey_question":{"answer":"At Home"}}'
1301
+ headers:
1302
+ User-Agent:
1303
+ - Faraday v0.9.0
1304
+ Content-Type:
1305
+ - application/json
1306
+ Api-Token:
1307
+ - testing
1308
+ User-Token:
1309
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1310
+ Service-User-Id:
1311
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1312
+ Accept-Encoding:
1313
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1314
+ Accept:
1315
+ - "*/*"
1316
+ response:
1317
+ status:
1318
+ code: 204
1319
+ message: 'No Content '
1320
+ headers:
1321
+ X-Frame-Options:
1322
+ - SAMEORIGIN
1323
+ X-Xss-Protection:
1324
+ - 1; mode=block
1325
+ X-Content-Type-Options:
1326
+ - nosniff
1327
+ X-Ua-Compatible:
1328
+ - chrome=1
1329
+ Cache-Control:
1330
+ - no-cache
1331
+ X-Request-Id:
1332
+ - 2b98ff06-ead6-457f-b7fe-433bd88648cc
1333
+ X-Runtime:
1334
+ - '0.011889'
1335
+ Server:
1336
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1337
+ Date:
1338
+ - Sun, 25 Jan 2015 14:07:15 GMT
1339
+ Connection:
1340
+ - Keep-Alive
1341
+ body:
1342
+ encoding: UTF-8
1343
+ string: ''
1344
+ http_version:
1345
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1346
+ - request:
1347
+ method: get
1348
+ uri: http://localhost:3000/api/surveys/103
1349
+ body:
1350
+ encoding: US-ASCII
1351
+ string: ''
1352
+ headers:
1353
+ User-Agent:
1354
+ - Faraday v0.9.0
1355
+ Content-Type:
1356
+ - application/json
1357
+ Api-Token:
1358
+ - testing
1359
+ User-Token:
1360
+ - 418d60ff35340cfae0ad820b9eafb9978fb0874e1568d6780ee1336413462779
1361
+ Service-User-Id:
1362
+ - 6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc
1363
+ Accept-Encoding:
1364
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1365
+ Accept:
1366
+ - "*/*"
1367
+ response:
1368
+ status:
1369
+ code: 200
1370
+ message: 'OK '
1371
+ headers:
1372
+ X-Frame-Options:
1373
+ - SAMEORIGIN
1374
+ X-Xss-Protection:
1375
+ - 1; mode=block
1376
+ X-Content-Type-Options:
1377
+ - nosniff
1378
+ X-Ua-Compatible:
1379
+ - chrome=1
1380
+ Content-Type:
1381
+ - application/json; charset=utf-8
1382
+ Etag:
1383
+ - '"43e759df167d0c076a33eaf43957068b"'
1384
+ Cache-Control:
1385
+ - max-age=0, private, must-revalidate
1386
+ X-Request-Id:
1387
+ - 2d85d43d-22f9-4452-85c5-d46157d2401b
1388
+ X-Runtime:
1389
+ - '0.015954'
1390
+ Server:
1391
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1392
+ Date:
1393
+ - Sun, 25 Jan 2015 14:07:15 GMT
1394
+ Content-Length:
1395
+ - '1202'
1396
+ Connection:
1397
+ - Keep-Alive
1398
+ body:
1399
+ encoding: UTF-8
1400
+ string: |-
1401
+ {
1402
+ "id": 103,
1403
+ "service_user_id": "6943fa049ba6492bfe8421e556fed40c1a486285f94703f8fa924306b1c61afc",
1404
+ "_links": [
1405
+ {
1406
+ "href": "http://localhost:3000/api/surveys/103",
1407
+ "rel": "self",
1408
+ "method": "GET"
1409
+ },
1410
+ {
1411
+ "href": "http://localhost:3000/api/surveys/103/survey_questions",
1412
+ "rel": "survey-questions",
1413
+ "method": "POST"
1414
+ }
1415
+ ],
1416
+ "completed": true,
1417
+ "survey_questions": [
1418
+ {
1419
+ "id": 57,
1420
+ "text": "Where are you?",
1421
+ "question_type": "multiple",
1422
+ "responses": [
1423
+ "At Home",
1424
+ "At Work",
1425
+ "In a car",
1426
+ "Other"
1427
+ ],
1428
+ "answer": "At Home",
1429
+ "_links": [
1430
+ {
1431
+ "rel": "self",
1432
+ "href": "http://localhost:3000/api/surveys/103/survey_questions/57",
1433
+ "method": "GET"
1434
+ },
1435
+ {
1436
+ "rel": "self",
1437
+ "href": "http://localhost:3000/api/surveys/103/survey_questions/57",
1438
+ "method": "PUT"
1439
+ },
1440
+ {
1441
+ "rel": "survey",
1442
+ "href": "http://localhost:3000/api/surveys/103",
1443
+ "method": "GET"
1444
+ }
1445
+ ],
1446
+ "created_at": "2015-01-25T14:07:15.309Z",
1447
+ "key": null,
1448
+ "question_id": 98
1449
+ }
1450
+ ]
1451
+ }
1452
+ http_version:
1453
+ recorded_at: Sun, 25 Jan 2015 14:07:15 GMT
1454
+ recorded_with: VCR 2.9.3