poptart 0.0.1

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 (39) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +1 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +3 -0
  6. data/Gemfile +3 -0
  7. data/Gemfile.lock +88 -0
  8. data/README.md +0 -0
  9. data/Rakefile +18 -0
  10. data/lib/poptart/.DS_Store +0 -0
  11. data/lib/poptart/model.rb +17 -0
  12. data/lib/poptart/question.rb +19 -0
  13. data/lib/poptart/request.rb +48 -0
  14. data/lib/poptart/root.rb +11 -0
  15. data/lib/poptart/survey.rb +37 -0
  16. data/lib/poptart/survey_question.rb +42 -0
  17. data/lib/poptart/user.rb +46 -0
  18. data/lib/poptart.rb +22 -0
  19. data/lib/version.rb +3 -0
  20. data/poptart.gemspec +31 -0
  21. data/spec/requests/answering_survey_questions_spec.rb +56 -0
  22. data/spec/requests/root_spec.rb +8 -0
  23. data/spec/requests/user_management_spec.rb +17 -0
  24. data/spec/spec_helper.rb +68 -0
  25. data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +1588 -0
  26. data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +330 -0
  27. data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +272 -0
  28. data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +330 -0
  29. data/spec/vcr/poptart/root/returns_survey_links.yml +72 -0
  30. data/spec/vcr/poptart/user/answers_a_survey_question.yml +1580 -0
  31. data/spec/vcr/poptart/user/creates_a_user.yml +135 -0
  32. data/spec/vcr/poptart/user/creates_and_returns_a_random_question_survey.yml +341 -0
  33. data/spec/vcr/poptart/user/creates_and_returns_an_empty_survey.yml +272 -0
  34. data/spec/vcr/poptart/user/finds_survey_question_for_id.yml +327 -0
  35. data/spec/vcr/poptart/user/returns_a_user.yml +267 -0
  36. data/spec/vcr/user/management_creates_a_user.yml +135 -0
  37. data/spec/vcr/user/management_returns_a_user.yml +267 -0
  38. data/tags +72 -0
  39. metadata +266 -0
@@ -0,0 +1,1588 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/surveys?random=true
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"survey":{"user_id":235}}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/json
14
+ Api-Token:
15
+ - testing
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: 'Created '
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Ua-Compatible:
32
+ - chrome=1
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ Etag:
36
+ - '"5fed12c67b93fae665202508f8295de0"'
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 7bbd56f8-4421-4f9f-8431-24c12bc9cbf1
41
+ X-Runtime:
42
+ - '0.079377'
43
+ Server:
44
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
45
+ Date:
46
+ - Mon, 26 May 2014 20:53:53 GMT
47
+ Content-Length:
48
+ - '3882'
49
+ Connection:
50
+ - Keep-Alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: |-
54
+ {
55
+ "id": 191,
56
+ "user_id": 235,
57
+ "survey_questions": [
58
+ {
59
+ "id": 665,
60
+ "text": "To what extent do you feel accepted by the person/people you are interacting with?",
61
+ "type": "range",
62
+ "responses": [
63
+ "0",
64
+ "10"
65
+ ],
66
+ "freeform": false,
67
+ "_links": {
68
+ "self": {
69
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/665"
70
+ },
71
+ "survey": {
72
+ "href": "http://localhost:3000/api/surveys/191"
73
+ },
74
+ "create": {
75
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
76
+ },
77
+ "submit": {
78
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/665"
79
+ }
80
+ }
81
+ },
82
+ {
83
+ "id": 666,
84
+ "text": "In general, how is your health?",
85
+ "type": "multiple",
86
+ "responses": [
87
+ "Excellent",
88
+ "Very Good",
89
+ "Good",
90
+ "Fair",
91
+ "Poor"
92
+ ],
93
+ "freeform": false,
94
+ "_links": {
95
+ "self": {
96
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/666"
97
+ },
98
+ "survey": {
99
+ "href": "http://localhost:3000/api/surveys/191"
100
+ },
101
+ "create": {
102
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
103
+ },
104
+ "submit": {
105
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/666"
106
+ }
107
+ }
108
+ },
109
+ {
110
+ "id": 667,
111
+ "text": "To what extent do you expect good things to happen in the future?",
112
+ "type": "range",
113
+ "responses": [
114
+ "0",
115
+ "10"
116
+ ],
117
+ "freeform": false,
118
+ "_links": {
119
+ "self": {
120
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/667"
121
+ },
122
+ "survey": {
123
+ "href": "http://localhost:3000/api/surveys/191"
124
+ },
125
+ "create": {
126
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
127
+ },
128
+ "submit": {
129
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/667"
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "id": 668,
135
+ "text": "How many people are you talking or interacting with?",
136
+ "type": "multiple",
137
+ "responses": [
138
+ "At Home",
139
+ "At Work",
140
+ "In a car"
141
+ ],
142
+ "freeform": false,
143
+ "_links": {
144
+ "self": {
145
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/668"
146
+ },
147
+ "survey": {
148
+ "href": "http://localhost:3000/api/surveys/191"
149
+ },
150
+ "create": {
151
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
152
+ },
153
+ "submit": {
154
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/668"
155
+ }
156
+ }
157
+ },
158
+ {
159
+ "id": 669,
160
+ "text": "Who are you talking or interacting with?",
161
+ "type": "multiple",
162
+ "responses": [
163
+ "Spouse/partner/significant other",
164
+ "Children",
165
+ "Parents",
166
+ "Other relatives",
167
+ "Friends",
168
+ "Acquaintances",
169
+ "Strangers",
170
+ "Co-workers",
171
+ "Customers/students",
172
+ "Boss"
173
+ ],
174
+ "freeform": true,
175
+ "_links": {
176
+ "self": {
177
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/669"
178
+ },
179
+ "survey": {
180
+ "href": "http://localhost:3000/api/surveys/191"
181
+ },
182
+ "create": {
183
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
184
+ },
185
+ "submit": {
186
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/669"
187
+ }
188
+ }
189
+ }
190
+ ],
191
+ "_links": {
192
+ "self": {
193
+ "href": "http://localhost:3000/api/surveys/191"
194
+ },
195
+ "submit": {
196
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
197
+ },
198
+ "next": {
199
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/665"
200
+ }
201
+ }
202
+ }
203
+ http_version:
204
+ recorded_at: Mon, 26 May 2014 20:53:53 GMT
205
+ - request:
206
+ method: put
207
+ uri: http://localhost:3000/api/surveys/191/survey_questions/665
208
+ body:
209
+ encoding: UTF-8
210
+ string: '{"id":665,"survey_question":{"answer":"foo"}}'
211
+ headers:
212
+ User-Agent:
213
+ - Faraday v0.9.0
214
+ Content-Type:
215
+ - application/json
216
+ Api-Token:
217
+ - testing
218
+ Accept-Encoding:
219
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
220
+ Accept:
221
+ - "*/*"
222
+ response:
223
+ status:
224
+ code: 204
225
+ message: 'No Content '
226
+ headers:
227
+ X-Frame-Options:
228
+ - SAMEORIGIN
229
+ X-Xss-Protection:
230
+ - 1; mode=block
231
+ X-Content-Type-Options:
232
+ - nosniff
233
+ X-Ua-Compatible:
234
+ - chrome=1
235
+ Cache-Control:
236
+ - no-cache
237
+ X-Request-Id:
238
+ - 1bc137fe-8629-4d72-a7cd-0520af268373
239
+ X-Runtime:
240
+ - '0.008954'
241
+ Server:
242
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
243
+ Date:
244
+ - Mon, 26 May 2014 20:53:53 GMT
245
+ Connection:
246
+ - Keep-Alive
247
+ body:
248
+ encoding: UTF-8
249
+ string: ''
250
+ http_version:
251
+ recorded_at: Mon, 26 May 2014 20:53:53 GMT
252
+ - request:
253
+ method: get
254
+ uri: http://localhost:3000/api/surveys/191
255
+ body:
256
+ encoding: US-ASCII
257
+ string: ''
258
+ headers:
259
+ User-Agent:
260
+ - Faraday v0.9.0
261
+ Content-Type:
262
+ - application/json
263
+ Api-Token:
264
+ - testing
265
+ Accept-Encoding:
266
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
267
+ Accept:
268
+ - "*/*"
269
+ response:
270
+ status:
271
+ code: 200
272
+ message: 'OK '
273
+ headers:
274
+ X-Frame-Options:
275
+ - SAMEORIGIN
276
+ X-Xss-Protection:
277
+ - 1; mode=block
278
+ X-Content-Type-Options:
279
+ - nosniff
280
+ X-Ua-Compatible:
281
+ - chrome=1
282
+ Content-Type:
283
+ - application/json; charset=utf-8
284
+ Etag:
285
+ - '"1339e833311c37169542a779cb13b016"'
286
+ Cache-Control:
287
+ - max-age=0, private, must-revalidate
288
+ X-Request-Id:
289
+ - 68d7db41-3bb1-4e02-a779-d7d1d2996050
290
+ X-Runtime:
291
+ - '0.057357'
292
+ Server:
293
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
294
+ Date:
295
+ - Mon, 26 May 2014 20:53:53 GMT
296
+ Content-Length:
297
+ - '3905'
298
+ Connection:
299
+ - Keep-Alive
300
+ body:
301
+ encoding: UTF-8
302
+ string: |-
303
+ {
304
+ "id": 191,
305
+ "user_id": 235,
306
+ "survey_questions": [
307
+ {
308
+ "id": 666,
309
+ "text": "In general, how is your health?",
310
+ "type": "multiple",
311
+ "responses": [
312
+ "Excellent",
313
+ "Very Good",
314
+ "Good",
315
+ "Fair",
316
+ "Poor"
317
+ ],
318
+ "freeform": false,
319
+ "_links": {
320
+ "self": {
321
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/666"
322
+ },
323
+ "survey": {
324
+ "href": "http://localhost:3000/api/surveys/191"
325
+ },
326
+ "create": {
327
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
328
+ },
329
+ "submit": {
330
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/666"
331
+ }
332
+ }
333
+ },
334
+ {
335
+ "id": 667,
336
+ "text": "To what extent do you expect good things to happen in the future?",
337
+ "type": "range",
338
+ "responses": [
339
+ "0",
340
+ "10"
341
+ ],
342
+ "freeform": false,
343
+ "_links": {
344
+ "self": {
345
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/667"
346
+ },
347
+ "survey": {
348
+ "href": "http://localhost:3000/api/surveys/191"
349
+ },
350
+ "create": {
351
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
352
+ },
353
+ "submit": {
354
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/667"
355
+ }
356
+ }
357
+ },
358
+ {
359
+ "id": 668,
360
+ "text": "How many people are you talking or interacting with?",
361
+ "type": "multiple",
362
+ "responses": [
363
+ "At Home",
364
+ "At Work",
365
+ "In a car"
366
+ ],
367
+ "freeform": false,
368
+ "_links": {
369
+ "self": {
370
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/668"
371
+ },
372
+ "survey": {
373
+ "href": "http://localhost:3000/api/surveys/191"
374
+ },
375
+ "create": {
376
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
377
+ },
378
+ "submit": {
379
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/668"
380
+ }
381
+ }
382
+ },
383
+ {
384
+ "id": 669,
385
+ "text": "Who are you talking or interacting with?",
386
+ "type": "multiple",
387
+ "responses": [
388
+ "Spouse/partner/significant other",
389
+ "Children",
390
+ "Parents",
391
+ "Other relatives",
392
+ "Friends",
393
+ "Acquaintances",
394
+ "Strangers",
395
+ "Co-workers",
396
+ "Customers/students",
397
+ "Boss"
398
+ ],
399
+ "freeform": true,
400
+ "_links": {
401
+ "self": {
402
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/669"
403
+ },
404
+ "survey": {
405
+ "href": "http://localhost:3000/api/surveys/191"
406
+ },
407
+ "create": {
408
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
409
+ },
410
+ "submit": {
411
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/669"
412
+ }
413
+ }
414
+ },
415
+ {
416
+ "id": 665,
417
+ "text": "To what extent do you feel accepted by the person/people you are interacting with?",
418
+ "type": "range",
419
+ "responses": [
420
+ "0",
421
+ "10"
422
+ ],
423
+ "answer": "foo",
424
+ "freeform": false,
425
+ "_links": {
426
+ "self": {
427
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/665"
428
+ },
429
+ "survey": {
430
+ "href": "http://localhost:3000/api/surveys/191"
431
+ },
432
+ "create": {
433
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
434
+ },
435
+ "submit": {
436
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/665"
437
+ }
438
+ }
439
+ }
440
+ ],
441
+ "_links": {
442
+ "self": {
443
+ "href": "http://localhost:3000/api/surveys/191"
444
+ },
445
+ "submit": {
446
+ "href": "http://localhost:3000/api/surveys/191/survey_questions"
447
+ },
448
+ "next": {
449
+ "href": "http://localhost:3000/api/surveys/191/survey_questions/666"
450
+ }
451
+ }
452
+ }
453
+ http_version:
454
+ recorded_at: Mon, 26 May 2014 20:53:53 GMT
455
+ - request:
456
+ method: get
457
+ uri: http://localhost:3000/
458
+ body:
459
+ encoding: US-ASCII
460
+ string: ''
461
+ headers:
462
+ User-Agent:
463
+ - Faraday v0.9.0
464
+ Content-Type:
465
+ - application/json
466
+ Api-Token:
467
+ - testing
468
+ Accept-Encoding:
469
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
470
+ Accept:
471
+ - "*/*"
472
+ response:
473
+ status:
474
+ code: 200
475
+ message: 'OK '
476
+ headers:
477
+ X-Frame-Options:
478
+ - SAMEORIGIN
479
+ X-Xss-Protection:
480
+ - 1; mode=block
481
+ X-Content-Type-Options:
482
+ - nosniff
483
+ X-Ua-Compatible:
484
+ - chrome=1
485
+ Content-Type:
486
+ - application/json; charset=utf-8
487
+ Etag:
488
+ - '"a723ac88b99a06c255a3384c2d01f4fb"'
489
+ Cache-Control:
490
+ - max-age=0, private, must-revalidate
491
+ X-Request-Id:
492
+ - d1dcad37-13ac-4bbe-abac-a58c98fc5a16
493
+ X-Runtime:
494
+ - '0.006919'
495
+ Server:
496
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
497
+ Date:
498
+ - Mon, 26 May 2014 20:54:17 GMT
499
+ Content-Length:
500
+ - '305'
501
+ Connection:
502
+ - Keep-Alive
503
+ body:
504
+ encoding: UTF-8
505
+ string: |-
506
+ {
507
+ "_links": {
508
+ "self": {
509
+ "href": "http://localhost:3000/api"
510
+ },
511
+ "surveys": {
512
+ "href": "http://localhost:3000/api/surveys"
513
+ },
514
+ "users": {
515
+ "href": "http://localhost:3000/api/users"
516
+ },
517
+ "questions": {
518
+ "href": "http://localhost:3000/api/questions"
519
+ }
520
+ }
521
+ }
522
+ http_version:
523
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
524
+ - request:
525
+ method: get
526
+ uri: http://localhost:3000/api/questions
527
+ body:
528
+ encoding: US-ASCII
529
+ string: ''
530
+ headers:
531
+ User-Agent:
532
+ - Faraday v0.9.0
533
+ Content-Type:
534
+ - application/json
535
+ Api-Token:
536
+ - testing
537
+ Accept-Encoding:
538
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
539
+ Accept:
540
+ - "*/*"
541
+ response:
542
+ status:
543
+ code: 200
544
+ message: 'OK '
545
+ headers:
546
+ X-Frame-Options:
547
+ - SAMEORIGIN
548
+ X-Xss-Protection:
549
+ - 1; mode=block
550
+ X-Content-Type-Options:
551
+ - nosniff
552
+ X-Ua-Compatible:
553
+ - chrome=1
554
+ Content-Type:
555
+ - application/json; charset=utf-8
556
+ Etag:
557
+ - '"431a273abcc40a3bb311bbe267ebed26"'
558
+ Cache-Control:
559
+ - max-age=0, private, must-revalidate
560
+ X-Request-Id:
561
+ - efe0ea24-a209-4bab-a600-6e9f35e326d1
562
+ X-Runtime:
563
+ - '0.013290'
564
+ Server:
565
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
566
+ Date:
567
+ - Mon, 26 May 2014 20:54:17 GMT
568
+ Content-Length:
569
+ - '10868'
570
+ Connection:
571
+ - Keep-Alive
572
+ body:
573
+ encoding: UTF-8
574
+ string: |-
575
+ [
576
+ {
577
+ "id": 1,
578
+ "text": "How hungry or full are you right now?",
579
+ "created_at": "2014-05-20T01:42:05.049Z",
580
+ "updated_at": "2014-05-20T01:42:05.054Z",
581
+ "responses": [
582
+ "Very hungry",
583
+ "Somewhat hungry",
584
+ "Neither full nor hungry",
585
+ "Somewhat full",
586
+ "Very full"
587
+ ],
588
+ "question_type": "multiple",
589
+ "freeform": false
590
+ },
591
+ {
592
+ "id": 2,
593
+ "text": "What time did you wake up this morning?",
594
+ "created_at": "2014-05-20T01:42:05.057Z",
595
+ "updated_at": "2014-05-20T01:42:05.057Z",
596
+ "responses": null,
597
+ "question_type": "time",
598
+ "freeform": false
599
+ },
600
+ {
601
+ "id": 3,
602
+ "text": "What time did you got to sleep last night?",
603
+ "created_at": "2014-05-20T01:42:05.059Z",
604
+ "updated_at": "2014-05-20T01:42:05.059Z",
605
+ "responses": null,
606
+ "question_type": "time",
607
+ "freeform": false
608
+ },
609
+ {
610
+ "id": 4,
611
+ "text": "Are you judging or evaluating yourself right now (i.e. at the moment just before you were notified)?",
612
+ "created_at": "2014-05-20T01:42:05.060Z",
613
+ "updated_at": "2014-05-20T01:42:05.062Z",
614
+ "responses": [
615
+ "f",
616
+ "Yes - Negatively",
617
+ "Yes - Neutrally",
618
+ "Yes - Positively"
619
+ ],
620
+ "question_type": "multiple",
621
+ "freeform": false
622
+ },
623
+ {
624
+ "id": 5,
625
+ "text": "How well did you sleep last night?",
626
+ "created_at": "2014-05-20T01:42:05.064Z",
627
+ "updated_at": "2014-05-20T01:42:05.065Z",
628
+ "responses": [
629
+ "0",
630
+ "10"
631
+ ],
632
+ "question_type": "range",
633
+ "freeform": false
634
+ },
635
+ {
636
+ "id": 6,
637
+ "text": "To what extent are you engrossed in what you are doing?",
638
+ "created_at": "2014-05-20T01:42:05.067Z",
639
+ "updated_at": "2014-05-20T01:42:05.068Z",
640
+ "responses": [
641
+ "0",
642
+ "10"
643
+ ],
644
+ "question_type": "range",
645
+ "freeform": false
646
+ },
647
+ {
648
+ "id": 7,
649
+ "text": "To what extent do you feel accepted by the person/people you are interacting with?",
650
+ "created_at": "2014-05-20T01:42:05.070Z",
651
+ "updated_at": "2014-05-20T01:42:05.071Z",
652
+ "responses": [
653
+ "0",
654
+ "10"
655
+ ],
656
+ "question_type": "range",
657
+ "freeform": false
658
+ },
659
+ {
660
+ "id": 8,
661
+ "text": "Are you judging or evaluating what you are doing right now (i.e. at the moment just before you were notified?)",
662
+ "created_at": "2014-05-20T01:42:05.073Z",
663
+ "updated_at": "2014-05-20T01:42:05.074Z",
664
+ "responses": [
665
+ "f",
666
+ "Yes - Negatively",
667
+ "Yes - Neutrally",
668
+ "Yes - Positively"
669
+ ],
670
+ "question_type": "multiple",
671
+ "freeform": false
672
+ },
673
+ {
674
+ "id": 9,
675
+ "text": "In the past 24 hours, have you engaged in sexual activity with another person?",
676
+ "created_at": "2014-05-20T01:42:05.076Z",
677
+ "updated_at": "2014-05-20T01:42:05.078Z",
678
+ "responses": [
679
+ "t",
680
+ "f"
681
+ ],
682
+ "question_type": "boolean",
683
+ "freeform": false
684
+ },
685
+ {
686
+ "id": 10,
687
+ "text": "Imagine you were given $10 to divide between yourself and a stranger to whom you would remain anonymous. How much would you give to the stranger?",
688
+ "created_at": "2014-05-20T01:42:05.080Z",
689
+ "updated_at": "2014-05-20T01:42:05.082Z",
690
+ "responses": [
691
+ [
692
+ "0",
693
+ "1",
694
+ "2",
695
+ "3",
696
+ "4",
697
+ "5",
698
+ "6",
699
+ "7",
700
+ "8",
701
+ "9",
702
+ "10"
703
+ ]
704
+ ],
705
+ "question_type": "multiple",
706
+ "freeform": false
707
+ },
708
+ {
709
+ "id": 11,
710
+ "text": "Have you surprised someone with a gift (including small gifts) in the last week?",
711
+ "created_at": "2014-05-20T01:42:05.085Z",
712
+ "updated_at": "2014-05-20T01:42:05.086Z",
713
+ "responses": [
714
+ "t",
715
+ "f"
716
+ ],
717
+ "question_type": "boolean",
718
+ "freeform": false
719
+ },
720
+ {
721
+ "id": 12,
722
+ "text": "In general, how is your health?",
723
+ "created_at": "2014-05-20T01:42:05.089Z",
724
+ "updated_at": "2014-05-20T01:42:05.090Z",
725
+ "responses": [
726
+ "Excellent",
727
+ "Very Good",
728
+ "Good",
729
+ "Fair",
730
+ "Poor"
731
+ ],
732
+ "question_type": "multiple",
733
+ "freeform": false
734
+ },
735
+ {
736
+ "id": 13,
737
+ "text": "Where would you place yourself on this ladder?\nThink of a ladder representing where people stand in your country.\nAt the top of the ladder are the people who are the best off - those who have the most money, the most education and the most respected jobs. At the bottom are the people who are the worst off - who have the least money, least education, and the least respected jobs or no job. The higher up you are on the ladder, the closer you are to the people at the very top; the lower you are the closer you are to people at the very bottom.",
738
+ "created_at": "2014-05-20T01:42:05.092Z",
739
+ "updated_at": "2014-05-20T01:42:05.093Z",
740
+ "responses": [
741
+ "0",
742
+ "10"
743
+ ],
744
+ "question_type": "range",
745
+ "freeform": false
746
+ },
747
+ {
748
+ "id": 14,
749
+ "text": "To what extent is what you're doing interesting?",
750
+ "created_at": "2014-05-20T01:42:05.095Z",
751
+ "updated_at": "2014-05-20T01:42:05.096Z",
752
+ "responses": [
753
+ "0",
754
+ "10"
755
+ ],
756
+ "question_type": "range",
757
+ "freeform": false
758
+ },
759
+ {
760
+ "id": 15,
761
+ "text": "On average, how many hours do you work each week?",
762
+ "created_at": "2014-05-20T01:42:05.098Z",
763
+ "updated_at": "2014-05-20T01:42:05.100Z",
764
+ "responses": [
765
+ "Less than 5",
766
+ "5-10",
767
+ "10-20",
768
+ "20-30",
769
+ "30-40",
770
+ "40-50",
771
+ "50-60",
772
+ "60-70",
773
+ "More than 70"
774
+ ],
775
+ "question_type": "multiple",
776
+ "freeform": false
777
+ },
778
+ {
779
+ "id": 16,
780
+ "text": "How do you feel right now?",
781
+ "created_at": "2014-05-20T01:42:05.102Z",
782
+ "updated_at": "2014-05-20T01:42:05.103Z",
783
+ "responses": [
784
+ "0",
785
+ "10"
786
+ ],
787
+ "question_type": "range",
788
+ "freeform": false
789
+ },
790
+ {
791
+ "id": 17,
792
+ "text": "To what extent do you expect good things to happen in the future?",
793
+ "created_at": "2014-05-20T01:42:05.105Z",
794
+ "updated_at": "2014-05-20T01:42:05.106Z",
795
+ "responses": [
796
+ "0",
797
+ "10"
798
+ ],
799
+ "question_type": "range",
800
+ "freeform": false
801
+ },
802
+ {
803
+ "id": 18,
804
+ "text": "Have you taken any over-the-counter pain medication in the past 24 hours?",
805
+ "created_at": "2014-05-20T01:42:05.108Z",
806
+ "updated_at": "2014-05-20T01:42:05.109Z",
807
+ "responses": [
808
+ "t",
809
+ "f"
810
+ ],
811
+ "question_type": "boolean",
812
+ "freeform": false
813
+ },
814
+ {
815
+ "id": 19,
816
+ "text": "To what extent have you procrastinated so far today?",
817
+ "created_at": "2014-05-20T01:42:05.111Z",
818
+ "updated_at": "2014-05-20T01:42:05.113Z",
819
+ "responses": [
820
+ "0",
821
+ "10"
822
+ ],
823
+ "question_type": "range",
824
+ "freeform": false
825
+ },
826
+ {
827
+ "id": 20,
828
+ "text": "To what extent are you being productive?",
829
+ "created_at": "2014-05-20T01:42:05.115Z",
830
+ "updated_at": "2014-05-20T01:42:05.116Z",
831
+ "responses": [
832
+ "0",
833
+ "10"
834
+ ],
835
+ "question_type": "range",
836
+ "freeform": false
837
+ },
838
+ {
839
+ "id": 21,
840
+ "text": "Who are you talking or interacting with?",
841
+ "created_at": "2014-05-20T01:42:05.117Z",
842
+ "updated_at": "2014-05-20T01:42:05.119Z",
843
+ "responses": [
844
+ "Spouse/partner/significant other",
845
+ "Children",
846
+ "Parents",
847
+ "Other relatives",
848
+ "Friends",
849
+ "Acquaintances",
850
+ "Strangers",
851
+ "Co-workers",
852
+ "Customers/students",
853
+ "Boss"
854
+ ],
855
+ "question_type": "multiple",
856
+ "freeform": true
857
+ },
858
+ {
859
+ "id": 22,
860
+ "text": "To what extent do you feel accepted by the person/people you are interacting with?",
861
+ "created_at": "2014-05-20T01:42:05.120Z",
862
+ "updated_at": "2014-05-20T01:42:05.122Z",
863
+ "responses": [
864
+ "0",
865
+ "10"
866
+ ],
867
+ "question_type": "range",
868
+ "freeform": false
869
+ },
870
+ {
871
+ "id": 23,
872
+ "text": "Are you alone?",
873
+ "created_at": "2014-05-20T01:42:05.124Z",
874
+ "updated_at": "2014-05-20T01:42:05.125Z",
875
+ "responses": [
876
+ "t",
877
+ "f"
878
+ ],
879
+ "question_type": "boolean",
880
+ "freeform": false
881
+ },
882
+ {
883
+ "id": 24,
884
+ "text": "Do you want to do what you're doing?",
885
+ "created_at": "2014-05-20T01:42:05.127Z",
886
+ "updated_at": "2014-05-20T01:42:05.128Z",
887
+ "responses": [
888
+ "t",
889
+ "f"
890
+ ],
891
+ "question_type": "boolean",
892
+ "freeform": false
893
+ },
894
+ {
895
+ "id": 25,
896
+ "text": "Are you talking or interacting with anyone?",
897
+ "created_at": "2014-05-20T01:42:05.130Z",
898
+ "updated_at": "2014-05-20T01:42:05.132Z",
899
+ "responses": [
900
+ "t",
901
+ "f"
902
+ ],
903
+ "question_type": "boolean",
904
+ "freeform": false
905
+ },
906
+ {
907
+ "id": 26,
908
+ "text": "Where are you?",
909
+ "created_at": "2014-05-20T01:42:05.134Z",
910
+ "updated_at": "2014-05-20T01:42:05.136Z",
911
+ "responses": [
912
+ "At Home",
913
+ "At Work",
914
+ "In a car",
915
+ "Other"
916
+ ],
917
+ "question_type": "multiple",
918
+ "freeform": true
919
+ },
920
+ {
921
+ "id": 27,
922
+ "text": "How many people are you talking or interacting with?",
923
+ "created_at": "2014-05-20T01:42:05.137Z",
924
+ "updated_at": "2014-05-20T01:42:05.139Z",
925
+ "responses": [
926
+ "At Home",
927
+ "At Work",
928
+ "In a car"
929
+ ],
930
+ "question_type": "multiple",
931
+ "freeform": false
932
+ },
933
+ {
934
+ "id": 28,
935
+ "text": "Do you have to do what you're doing?",
936
+ "created_at": "2014-05-20T01:42:05.141Z",
937
+ "updated_at": "2014-05-20T01:42:05.142Z",
938
+ "responses": [
939
+ "t",
940
+ "f"
941
+ ],
942
+ "question_type": "boolean",
943
+ "freeform": false
944
+ },
945
+ {
946
+ "id": 29,
947
+ "text": "To what extent are you focused on what you are doing?",
948
+ "created_at": "2014-05-20T01:42:05.144Z",
949
+ "updated_at": "2014-05-20T01:42:05.146Z",
950
+ "responses": [
951
+ "0",
952
+ "10"
953
+ ],
954
+ "question_type": "range",
955
+ "freeform": false
956
+ },
957
+ {
958
+ "id": 30,
959
+ "text": "When did you last check Facebook?",
960
+ "created_at": "2014-05-20T01:42:05.148Z",
961
+ "updated_at": "2014-05-20T01:42:05.150Z",
962
+ "responses": [
963
+ "Right now",
964
+ "In the last 5 minutes",
965
+ "In the last 15 minutes",
966
+ "In the last 30 minutes",
967
+ "In the last hour",
968
+ "1-2 hours ago",
969
+ "3-5 hours ago",
970
+ "6-12 hours ago",
971
+ "24 hours ago",
972
+ "Don't use facebook"
973
+ ],
974
+ "question_type": "multiple",
975
+ "freeform": false
976
+ },
977
+ {
978
+ "id": 31,
979
+ "text": "Beyond any work you've already done today, how many additional hours do you expect to work today?",
980
+ "created_at": "2014-05-20T01:42:05.152Z",
981
+ "updated_at": "2014-05-20T01:42:05.153Z",
982
+ "responses": [
983
+ "0 (none)",
984
+ "Less than 1 hour",
985
+ "1-2 hours",
986
+ "2-3 hours",
987
+ "3-4 hours",
988
+ "4-5 hours",
989
+ "5-6 hours"
990
+ ],
991
+ "question_type": "multiple",
992
+ "freeform": false
993
+ },
994
+ {
995
+ "id": 32,
996
+ "text": "If you could, and it had no negative consequences, would you jump forward in time 24 hours?",
997
+ "created_at": "2014-05-20T01:42:05.155Z",
998
+ "updated_at": "2014-05-20T01:42:05.156Z",
999
+ "responses": [
1000
+ "t",
1001
+ "f"
1002
+ ],
1003
+ "question_type": "boolean",
1004
+ "freeform": false
1005
+ }
1006
+ ]
1007
+ http_version:
1008
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1009
+ - request:
1010
+ method: get
1011
+ uri: http://localhost:3000/
1012
+ body:
1013
+ encoding: US-ASCII
1014
+ string: ''
1015
+ headers:
1016
+ User-Agent:
1017
+ - Faraday v0.9.0
1018
+ Content-Type:
1019
+ - application/json
1020
+ Api-Token:
1021
+ - testing
1022
+ Accept-Encoding:
1023
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1024
+ Accept:
1025
+ - "*/*"
1026
+ response:
1027
+ status:
1028
+ code: 200
1029
+ message: 'OK '
1030
+ headers:
1031
+ X-Frame-Options:
1032
+ - SAMEORIGIN
1033
+ X-Xss-Protection:
1034
+ - 1; mode=block
1035
+ X-Content-Type-Options:
1036
+ - nosniff
1037
+ X-Ua-Compatible:
1038
+ - chrome=1
1039
+ Content-Type:
1040
+ - application/json; charset=utf-8
1041
+ Etag:
1042
+ - '"a723ac88b99a06c255a3384c2d01f4fb"'
1043
+ Cache-Control:
1044
+ - max-age=0, private, must-revalidate
1045
+ X-Request-Id:
1046
+ - ae85ff78-f1fe-4b67-ad5d-ea1ce398d7d2
1047
+ X-Runtime:
1048
+ - '0.006352'
1049
+ Server:
1050
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1051
+ Date:
1052
+ - Mon, 26 May 2014 20:54:17 GMT
1053
+ Content-Length:
1054
+ - '305'
1055
+ Connection:
1056
+ - Keep-Alive
1057
+ body:
1058
+ encoding: UTF-8
1059
+ string: |-
1060
+ {
1061
+ "_links": {
1062
+ "self": {
1063
+ "href": "http://localhost:3000/api"
1064
+ },
1065
+ "surveys": {
1066
+ "href": "http://localhost:3000/api/surveys"
1067
+ },
1068
+ "users": {
1069
+ "href": "http://localhost:3000/api/users"
1070
+ },
1071
+ "questions": {
1072
+ "href": "http://localhost:3000/api/questions"
1073
+ }
1074
+ }
1075
+ }
1076
+ http_version:
1077
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1078
+ - request:
1079
+ method: post
1080
+ uri: http://localhost:3000/api/users
1081
+ body:
1082
+ encoding: UTF-8
1083
+ string: '{"user":{"external_user_id":42}}'
1084
+ headers:
1085
+ User-Agent:
1086
+ - Faraday v0.9.0
1087
+ Content-Type:
1088
+ - application/json
1089
+ Api-Token:
1090
+ - testing
1091
+ Accept-Encoding:
1092
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1093
+ Accept:
1094
+ - "*/*"
1095
+ response:
1096
+ status:
1097
+ code: 201
1098
+ message: 'Created '
1099
+ headers:
1100
+ X-Frame-Options:
1101
+ - SAMEORIGIN
1102
+ X-Xss-Protection:
1103
+ - 1; mode=block
1104
+ X-Content-Type-Options:
1105
+ - nosniff
1106
+ X-Ua-Compatible:
1107
+ - chrome=1
1108
+ Content-Type:
1109
+ - application/json; charset=utf-8
1110
+ Etag:
1111
+ - '"a0c9fd9455eeebc900228bd6b7e9c2e9"'
1112
+ Cache-Control:
1113
+ - max-age=0, private, must-revalidate
1114
+ X-Request-Id:
1115
+ - a7932a3b-ea31-4022-9e40-0445426fee9d
1116
+ X-Runtime:
1117
+ - '0.013669'
1118
+ Server:
1119
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1120
+ Date:
1121
+ - Mon, 26 May 2014 20:54:17 GMT
1122
+ Content-Length:
1123
+ - '275'
1124
+ Connection:
1125
+ - Keep-Alive
1126
+ body:
1127
+ encoding: UTF-8
1128
+ string: |-
1129
+ {
1130
+ "id": 239,
1131
+ "external_user_id": 42,
1132
+ "token": "59c7eb561abefed6c650a3e3f96c68e2fb8550ce3365f06a5de4444888cf12123524b94da7d33af86fc1f88e960d8e01aa41a614abdf584bc47ac3be9e012e6c",
1133
+ "_links": {
1134
+ "self": {
1135
+ "href": "http://localhost:3000/api/users/239"
1136
+ }
1137
+ }
1138
+ }
1139
+ http_version:
1140
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1141
+ - request:
1142
+ method: get
1143
+ uri: http://localhost:3000/
1144
+ body:
1145
+ encoding: US-ASCII
1146
+ string: ''
1147
+ headers:
1148
+ User-Agent:
1149
+ - Faraday v0.9.0
1150
+ Content-Type:
1151
+ - application/json
1152
+ Api-Token:
1153
+ - testing
1154
+ Accept-Encoding:
1155
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1156
+ Accept:
1157
+ - "*/*"
1158
+ response:
1159
+ status:
1160
+ code: 200
1161
+ message: 'OK '
1162
+ headers:
1163
+ X-Frame-Options:
1164
+ - SAMEORIGIN
1165
+ X-Xss-Protection:
1166
+ - 1; mode=block
1167
+ X-Content-Type-Options:
1168
+ - nosniff
1169
+ X-Ua-Compatible:
1170
+ - chrome=1
1171
+ Content-Type:
1172
+ - application/json; charset=utf-8
1173
+ Etag:
1174
+ - '"a723ac88b99a06c255a3384c2d01f4fb"'
1175
+ Cache-Control:
1176
+ - max-age=0, private, must-revalidate
1177
+ X-Request-Id:
1178
+ - 8aa6326f-0ba6-43ba-8f82-26f21e285252
1179
+ X-Runtime:
1180
+ - '0.007166'
1181
+ Server:
1182
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1183
+ Date:
1184
+ - Mon, 26 May 2014 20:54:17 GMT
1185
+ Content-Length:
1186
+ - '305'
1187
+ Connection:
1188
+ - Keep-Alive
1189
+ body:
1190
+ encoding: UTF-8
1191
+ string: |-
1192
+ {
1193
+ "_links": {
1194
+ "self": {
1195
+ "href": "http://localhost:3000/api"
1196
+ },
1197
+ "surveys": {
1198
+ "href": "http://localhost:3000/api/surveys"
1199
+ },
1200
+ "users": {
1201
+ "href": "http://localhost:3000/api/users"
1202
+ },
1203
+ "questions": {
1204
+ "href": "http://localhost:3000/api/questions"
1205
+ }
1206
+ }
1207
+ }
1208
+ http_version:
1209
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1210
+ - request:
1211
+ method: post
1212
+ uri: http://localhost:3000/api/surveys
1213
+ body:
1214
+ encoding: UTF-8
1215
+ string: '{"survey":{"user_id":239}}'
1216
+ headers:
1217
+ User-Agent:
1218
+ - Faraday v0.9.0
1219
+ Content-Type:
1220
+ - application/json
1221
+ Api-Token:
1222
+ - testing
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
+ - '"238a49a871ce5e7248c1fc612a55e4e8"'
1244
+ Cache-Control:
1245
+ - max-age=0, private, must-revalidate
1246
+ X-Request-Id:
1247
+ - 98f41b86-56b6-4d3f-848f-9a27b74e080b
1248
+ X-Runtime:
1249
+ - '0.015086'
1250
+ Server:
1251
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1252
+ Date:
1253
+ - Mon, 26 May 2014 20:54:17 GMT
1254
+ Content-Length:
1255
+ - '250'
1256
+ Connection:
1257
+ - Keep-Alive
1258
+ body:
1259
+ encoding: UTF-8
1260
+ string: |-
1261
+ {
1262
+ "id": 193,
1263
+ "user_id": 239,
1264
+ "survey_questions": [
1265
+
1266
+ ],
1267
+ "_links": {
1268
+ "self": {
1269
+ "href": "http://localhost:3000/api/surveys/193"
1270
+ },
1271
+ "submit": {
1272
+ "href": "http://localhost:3000/api/surveys/193/survey_questions"
1273
+ }
1274
+ }
1275
+ }
1276
+ http_version:
1277
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1278
+ - request:
1279
+ method: post
1280
+ uri: http://localhost:3000/api/surveys/193/survey_questions
1281
+ body:
1282
+ encoding: UTF-8
1283
+ string: '{"survey_question":{"question_id":9}}'
1284
+ headers:
1285
+ User-Agent:
1286
+ - Faraday v0.9.0
1287
+ Content-Type:
1288
+ - application/json
1289
+ Api-Token:
1290
+ - testing
1291
+ Accept-Encoding:
1292
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1293
+ Accept:
1294
+ - "*/*"
1295
+ response:
1296
+ status:
1297
+ code: 201
1298
+ message: 'Created '
1299
+ headers:
1300
+ X-Frame-Options:
1301
+ - SAMEORIGIN
1302
+ X-Xss-Protection:
1303
+ - 1; mode=block
1304
+ X-Content-Type-Options:
1305
+ - nosniff
1306
+ X-Ua-Compatible:
1307
+ - chrome=1
1308
+ Content-Type:
1309
+ - application/json; charset=utf-8
1310
+ Etag:
1311
+ - '"b8955b885b4b7f97be496a48a7be4a5b"'
1312
+ Cache-Control:
1313
+ - max-age=0, private, must-revalidate
1314
+ X-Request-Id:
1315
+ - 677e3981-3ee8-4340-b76d-de49b8464d6c
1316
+ X-Runtime:
1317
+ - '0.019323'
1318
+ Server:
1319
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1320
+ Date:
1321
+ - Mon, 26 May 2014 20:54:17 GMT
1322
+ Content-Length:
1323
+ - '571'
1324
+ Connection:
1325
+ - Keep-Alive
1326
+ body:
1327
+ encoding: UTF-8
1328
+ string: |-
1329
+ {
1330
+ "id": 675,
1331
+ "text": "In the past 24 hours, have you engaged in sexual activity with another person?",
1332
+ "type": "boolean",
1333
+ "responses": [
1334
+ "t",
1335
+ "f"
1336
+ ],
1337
+ "freeform": false,
1338
+ "_links": {
1339
+ "self": {
1340
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1341
+ },
1342
+ "survey": {
1343
+ "href": "http://localhost:3000/api/surveys/193"
1344
+ },
1345
+ "create": {
1346
+ "href": "http://localhost:3000/api/surveys/193/survey_questions"
1347
+ },
1348
+ "submit": {
1349
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1350
+ }
1351
+ }
1352
+ }
1353
+ http_version:
1354
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1355
+ - request:
1356
+ method: get
1357
+ uri: http://localhost:3000/api/surveys/193
1358
+ body:
1359
+ encoding: US-ASCII
1360
+ string: ''
1361
+ headers:
1362
+ User-Agent:
1363
+ - Faraday v0.9.0
1364
+ Content-Type:
1365
+ - application/json
1366
+ Api-Token:
1367
+ - testing
1368
+ Accept-Encoding:
1369
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1370
+ Accept:
1371
+ - "*/*"
1372
+ response:
1373
+ status:
1374
+ code: 200
1375
+ message: 'OK '
1376
+ headers:
1377
+ X-Frame-Options:
1378
+ - SAMEORIGIN
1379
+ X-Xss-Protection:
1380
+ - 1; mode=block
1381
+ X-Content-Type-Options:
1382
+ - nosniff
1383
+ X-Ua-Compatible:
1384
+ - chrome=1
1385
+ Content-Type:
1386
+ - application/json; charset=utf-8
1387
+ Etag:
1388
+ - '"b5701c0481185b5b47f77a7e5925e825"'
1389
+ Cache-Control:
1390
+ - max-age=0, private, must-revalidate
1391
+ X-Request-Id:
1392
+ - f32a1d2a-f1d0-45ad-91b1-77085142ae51
1393
+ X-Runtime:
1394
+ - '0.020149'
1395
+ Server:
1396
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1397
+ Date:
1398
+ - Mon, 26 May 2014 20:54:17 GMT
1399
+ Content-Length:
1400
+ - '1013'
1401
+ Connection:
1402
+ - Keep-Alive
1403
+ body:
1404
+ encoding: UTF-8
1405
+ string: |-
1406
+ {
1407
+ "id": 193,
1408
+ "user_id": 239,
1409
+ "survey_questions": [
1410
+ {
1411
+ "id": 675,
1412
+ "text": "In the past 24 hours, have you engaged in sexual activity with another person?",
1413
+ "type": "boolean",
1414
+ "responses": [
1415
+ "t",
1416
+ "f"
1417
+ ],
1418
+ "freeform": false,
1419
+ "_links": {
1420
+ "self": {
1421
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1422
+ },
1423
+ "survey": {
1424
+ "href": "http://localhost:3000/api/surveys/193"
1425
+ },
1426
+ "create": {
1427
+ "href": "http://localhost:3000/api/surveys/193/survey_questions"
1428
+ },
1429
+ "submit": {
1430
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1431
+ }
1432
+ }
1433
+ }
1434
+ ],
1435
+ "_links": {
1436
+ "self": {
1437
+ "href": "http://localhost:3000/api/surveys/193"
1438
+ },
1439
+ "submit": {
1440
+ "href": "http://localhost:3000/api/surveys/193/survey_questions"
1441
+ },
1442
+ "next": {
1443
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1444
+ }
1445
+ }
1446
+ }
1447
+ http_version:
1448
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1449
+ - request:
1450
+ method: put
1451
+ uri: http://localhost:3000/api/surveys/193/survey_questions/675
1452
+ body:
1453
+ encoding: UTF-8
1454
+ string: '{"id":675,"survey_question":{"answer":"true"}}'
1455
+ headers:
1456
+ User-Agent:
1457
+ - Faraday v0.9.0
1458
+ Content-Type:
1459
+ - application/json
1460
+ Api-Token:
1461
+ - testing
1462
+ Accept-Encoding:
1463
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1464
+ Accept:
1465
+ - "*/*"
1466
+ response:
1467
+ status:
1468
+ code: 204
1469
+ message: 'No Content '
1470
+ headers:
1471
+ X-Frame-Options:
1472
+ - SAMEORIGIN
1473
+ X-Xss-Protection:
1474
+ - 1; mode=block
1475
+ X-Content-Type-Options:
1476
+ - nosniff
1477
+ X-Ua-Compatible:
1478
+ - chrome=1
1479
+ Cache-Control:
1480
+ - no-cache
1481
+ X-Request-Id:
1482
+ - cc7a73dc-7ab6-4be2-802d-a048c50ebc2c
1483
+ X-Runtime:
1484
+ - '0.009526'
1485
+ Server:
1486
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1487
+ Date:
1488
+ - Mon, 26 May 2014 20:54:17 GMT
1489
+ Connection:
1490
+ - Keep-Alive
1491
+ body:
1492
+ encoding: UTF-8
1493
+ string: ''
1494
+ http_version:
1495
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1496
+ - request:
1497
+ method: get
1498
+ uri: http://localhost:3000/api/surveys/193
1499
+ body:
1500
+ encoding: US-ASCII
1501
+ string: ''
1502
+ headers:
1503
+ User-Agent:
1504
+ - Faraday v0.9.0
1505
+ Content-Type:
1506
+ - application/json
1507
+ Api-Token:
1508
+ - testing
1509
+ Accept-Encoding:
1510
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1511
+ Accept:
1512
+ - "*/*"
1513
+ response:
1514
+ status:
1515
+ code: 200
1516
+ message: 'OK '
1517
+ headers:
1518
+ X-Frame-Options:
1519
+ - SAMEORIGIN
1520
+ X-Xss-Protection:
1521
+ - 1; mode=block
1522
+ X-Content-Type-Options:
1523
+ - nosniff
1524
+ X-Ua-Compatible:
1525
+ - chrome=1
1526
+ Content-Type:
1527
+ - application/json; charset=utf-8
1528
+ Etag:
1529
+ - '"ef20da63db6f97098035a804db644d52"'
1530
+ Cache-Control:
1531
+ - max-age=0, private, must-revalidate
1532
+ X-Request-Id:
1533
+ - af8273a6-82dc-4727-a3f0-e54f49668528
1534
+ X-Runtime:
1535
+ - '0.019528'
1536
+ Server:
1537
+ - WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
1538
+ Date:
1539
+ - Mon, 26 May 2014 20:54:17 GMT
1540
+ Content-Length:
1541
+ - '941'
1542
+ Connection:
1543
+ - Keep-Alive
1544
+ body:
1545
+ encoding: UTF-8
1546
+ string: |-
1547
+ {
1548
+ "id": 193,
1549
+ "user_id": 239,
1550
+ "survey_questions": [
1551
+ {
1552
+ "id": 675,
1553
+ "text": "In the past 24 hours, have you engaged in sexual activity with another person?",
1554
+ "type": "boolean",
1555
+ "responses": [
1556
+ "t",
1557
+ "f"
1558
+ ],
1559
+ "answer": "true",
1560
+ "freeform": false,
1561
+ "_links": {
1562
+ "self": {
1563
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1564
+ },
1565
+ "survey": {
1566
+ "href": "http://localhost:3000/api/surveys/193"
1567
+ },
1568
+ "create": {
1569
+ "href": "http://localhost:3000/api/surveys/193/survey_questions"
1570
+ },
1571
+ "submit": {
1572
+ "href": "http://localhost:3000/api/surveys/193/survey_questions/675"
1573
+ }
1574
+ }
1575
+ }
1576
+ ],
1577
+ "_links": {
1578
+ "self": {
1579
+ "href": "http://localhost:3000/api/surveys/193"
1580
+ },
1581
+ "submit": {
1582
+ "href": "http://localhost:3000/api/surveys/193/survey_questions"
1583
+ }
1584
+ }
1585
+ }
1586
+ http_version:
1587
+ recorded_at: Mon, 26 May 2014 20:54:17 GMT
1588
+ recorded_with: VCR 2.6.0