poptart 0.0.5 → 0.0.6

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.
@@ -37,13 +37,13 @@ http_interactions:
37
37
  Cache-Control:
38
38
  - max-age=0, private, must-revalidate
39
39
  X-Request-Id:
40
- - df0f3b6d-aeeb-42af-a214-5af9095da328
40
+ - c5a25952-0d62-4615-bc58-ca916bc21d27
41
41
  X-Runtime:
42
- - '0.004978'
42
+ - '0.004535'
43
43
  Server:
44
44
  - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
45
45
  Date:
46
- - Sat, 05 Jul 2014 21:24:17 GMT
46
+ - Tue, 09 Sep 2014 23:20:54 GMT
47
47
  Content-Length:
48
48
  - '305'
49
49
  Connection:
@@ -68,7 +68,7 @@ http_interactions:
68
68
  }
69
69
  }
70
70
  http_version:
71
- recorded_at: Sat, 05 Jul 2014 21:24:17 GMT
71
+ recorded_at: Tue, 09 Sep 2014 23:20:54 GMT
72
72
  - request:
73
73
  method: post
74
74
  uri: http://localhost:3000/api/users
@@ -102,41 +102,41 @@ http_interactions:
102
102
  Content-Type:
103
103
  - application/json; charset=utf-8
104
104
  Etag:
105
- - '"2772170e3956529c7198f466680c1a23"'
105
+ - '"1984ca647e67bee3954a60eb3713a70e"'
106
106
  Cache-Control:
107
107
  - max-age=0, private, must-revalidate
108
108
  X-Request-Id:
109
- - 8310ee2c-16be-49ad-acec-81fa8d7ea25a
109
+ - da1652ba-34df-49c4-bdcd-b4dd8d6c80db
110
110
  X-Runtime:
111
- - '0.006521'
111
+ - '0.006685'
112
112
  Server:
113
113
  - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
114
114
  Date:
115
- - Sat, 05 Jul 2014 21:24:17 GMT
115
+ - Tue, 09 Sep 2014 23:20:54 GMT
116
116
  Content-Length:
117
- - '132'
117
+ - '130'
118
118
  Connection:
119
119
  - Keep-Alive
120
120
  body:
121
121
  encoding: UTF-8
122
122
  string: |-
123
123
  {
124
- "id": 325,
124
+ "id": 55,
125
125
  "external_user_id": 42,
126
126
  "_links": {
127
127
  "self": {
128
- "href": "http://localhost:3000/api/users/325"
128
+ "href": "http://localhost:3000/api/users/55"
129
129
  }
130
130
  }
131
131
  }
132
132
  http_version:
133
- recorded_at: Sat, 05 Jul 2014 21:24:17 GMT
133
+ recorded_at: Tue, 09 Sep 2014 23:20:54 GMT
134
134
  - request:
135
135
  method: post
136
136
  uri: http://localhost:3000/api/surveys?random=true
137
137
  body:
138
138
  encoding: UTF-8
139
- string: '{"survey":{"user_id":325}}'
139
+ string: '{"survey":{"user_id":55}}'
140
140
  headers:
141
141
  User-Agent:
142
142
  - Faraday v0.9.0
@@ -164,38 +164,38 @@ http_interactions:
164
164
  Content-Type:
165
165
  - application/json; charset=utf-8
166
166
  Etag:
167
- - '"80ca94882419640dffc7637d1dd6721b"'
167
+ - '"1c41ed0fcd5af60ec158ee9028502ae8"'
168
168
  Cache-Control:
169
169
  - max-age=0, private, must-revalidate
170
170
  X-Request-Id:
171
- - 5a9e667a-1c6a-42d0-908e-8cf5977e2d4e
171
+ - 0c15d971-0db0-4f01-896c-0c37a6b62acc
172
172
  X-Runtime:
173
- - '0.044858'
173
+ - '0.035550'
174
174
  Server:
175
175
  - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
176
176
  Date:
177
- - Sat, 05 Jul 2014 21:24:17 GMT
177
+ - Tue, 09 Sep 2014 23:20:54 GMT
178
178
  Content-Length:
179
- - '4407'
179
+ - '4118'
180
180
  Connection:
181
181
  - Keep-Alive
182
182
  body:
183
183
  encoding: UTF-8
184
184
  string: |-
185
185
  {
186
- "id": 275,
187
- "user_id": 325,
186
+ "id": 46,
187
+ "user_id": 55,
188
188
  "_links": {
189
189
  "self": {
190
- "href": "http://localhost:3000/api/surveys/275"
190
+ "href": "http://localhost:3000/api/surveys/46"
191
191
  },
192
192
  "submit": {
193
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
193
+ "href": "http://localhost:3000/api/surveys/46/survey_questions"
194
194
  }
195
195
  },
196
196
  "survey_questions": [
197
197
  {
198
- "id": 1001,
198
+ "id": 126,
199
199
  "text": "How do you feel right now?",
200
200
  "type": "range",
201
201
  "responses": [
@@ -206,47 +206,76 @@ http_interactions:
206
206
  "freeform": false,
207
207
  "_links": {
208
208
  "self": {
209
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1001"
209
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/126"
210
210
  },
211
211
  "survey": {
212
- "href": "http://localhost:3000/api/surveys/275"
212
+ "href": "http://localhost:3000/api/surveys/46"
213
213
  },
214
214
  "create": {
215
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
215
+ "href": "http://localhost:3000/api/surveys/46/survey_questions"
216
216
  },
217
217
  "submit": {
218
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1001"
218
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/126"
219
219
  }
220
220
  }
221
221
  },
222
222
  {
223
- "id": 1002,
224
- "text": "To what extent is what you're doing interesting?",
225
- "type": "range",
223
+ "id": 127,
224
+ "text": "Where are you?",
225
+ "type": "multiple",
226
226
  "responses": [
227
- "0",
228
- "10"
227
+ "At Home",
228
+ "At Work",
229
+ "In a car",
230
+ "Other"
231
+ ],
232
+ "answer": null,
233
+ "freeform": true,
234
+ "_links": {
235
+ "self": {
236
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/127"
237
+ },
238
+ "survey": {
239
+ "href": "http://localhost:3000/api/surveys/46"
240
+ },
241
+ "create": {
242
+ "href": "http://localhost:3000/api/surveys/46/survey_questions"
243
+ },
244
+ "submit": {
245
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/127"
246
+ }
247
+ }
248
+ },
249
+ {
250
+ "id": 128,
251
+ "text": "Are you judging or evaluating what you are doing right now (i.e. at the moment just before you were notified?)",
252
+ "type": "multiple",
253
+ "responses": [
254
+ "f",
255
+ "Yes - Negatively",
256
+ "Yes - Neutrally",
257
+ "Yes - Positively"
229
258
  ],
230
259
  "answer": null,
231
260
  "freeform": false,
232
261
  "_links": {
233
262
  "self": {
234
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1002"
263
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/128"
235
264
  },
236
265
  "survey": {
237
- "href": "http://localhost:3000/api/surveys/275"
266
+ "href": "http://localhost:3000/api/surveys/46"
238
267
  },
239
268
  "create": {
240
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
269
+ "href": "http://localhost:3000/api/surveys/46/survey_questions"
241
270
  },
242
271
  "submit": {
243
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1002"
272
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/128"
244
273
  }
245
274
  }
246
275
  },
247
276
  {
248
- "id": 1003,
249
- "text": "To what extent are you focused on what you are doing?",
277
+ "id": 129,
278
+ "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.",
250
279
  "type": "range",
251
280
  "responses": [
252
281
  "0",
@@ -256,52 +285,891 @@ http_interactions:
256
285
  "freeform": false,
257
286
  "_links": {
258
287
  "self": {
259
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1003"
288
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/129"
260
289
  },
261
290
  "survey": {
262
- "href": "http://localhost:3000/api/surveys/275"
291
+ "href": "http://localhost:3000/api/surveys/46"
263
292
  },
264
293
  "create": {
265
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
294
+ "href": "http://localhost:3000/api/surveys/46/survey_questions"
266
295
  },
267
296
  "submit": {
268
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1003"
297
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/129"
269
298
  }
270
299
  }
271
300
  },
272
301
  {
273
- "id": 1004,
274
- "text": "Beyond any work you've already done today, how many additional hours do you expect to work today?",
275
- "type": "multiple",
302
+ "id": 130,
303
+ "text": "Are you alone?",
304
+ "type": "boolean",
276
305
  "responses": [
277
- "0 (none)",
278
- "Less than 1 hour",
279
- "1-2 hours",
280
- "2-3 hours",
281
- "3-4 hours",
282
- "4-5 hours",
283
- "5-6 hours"
306
+ "t",
307
+ "f"
284
308
  ],
285
309
  "answer": null,
286
310
  "freeform": false,
287
311
  "_links": {
288
312
  "self": {
289
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1004"
313
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/130"
290
314
  },
291
315
  "survey": {
292
- "href": "http://localhost:3000/api/surveys/275"
316
+ "href": "http://localhost:3000/api/surveys/46"
293
317
  },
294
318
  "create": {
295
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
319
+ "href": "http://localhost:3000/api/surveys/46/survey_questions"
296
320
  },
297
321
  "submit": {
298
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1004"
322
+ "href": "http://localhost:3000/api/surveys/46/survey_questions/130"
299
323
  }
300
324
  }
325
+ }
326
+ ]
327
+ }
328
+ http_version:
329
+ recorded_at: Tue, 09 Sep 2014 23:20:54 GMT
330
+ - request:
331
+ method: post
332
+ uri: http://localhost:3000/api/http:%2F%2Flocalhost:3000%2Fapi%2F%252Fusers%2F/
333
+ body:
334
+ encoding: UTF-8
335
+ string: '{"user":{"external_user_id":42}}'
336
+ headers:
337
+ User-Agent:
338
+ - Faraday v0.9.0
339
+ Content-Type:
340
+ - application/json
341
+ Api-Token:
342
+ - testing
343
+ Accept-Encoding:
344
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
345
+ Accept:
346
+ - "*/*"
347
+ response:
348
+ status:
349
+ code: 404
350
+ message: 'Not Found '
351
+ headers:
352
+ Content-Type:
353
+ - text/html; charset=utf-8
354
+ Content-Length:
355
+ - '16625'
356
+ X-Request-Id:
357
+ - 3151d54d-7385-4619-b8c4-ecd6a4fea46b
358
+ X-Runtime:
359
+ - '0.021666'
360
+ Server:
361
+ - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
362
+ Date:
363
+ - Sat, 13 Sep 2014 15:26:49 GMT
364
+ Connection:
365
+ - Keep-Alive
366
+ body:
367
+ encoding: UTF-8
368
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
369
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
370
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
371
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
372
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
373
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
374
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
375
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
376
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
377
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
378
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
379
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
380
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
381
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
382
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
383
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
384
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
385
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
386
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
387
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
388
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
389
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
390
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
391
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
392
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
393
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
394
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
395
+ { color: #C52F24; }\n\n #route_table {\n margin: 0 auto 0;\n border-collapse:
396
+ collapse;\n }\n\n #route_table td {\n padding: 0 30px;\n }\n\n #route_table
397
+ tr.bottom th {\n padding-bottom: 10px;\n line-height: 15px;\n }\n\n
398
+ \ #route_table .matched_paths {\n background-color: LightGoldenRodYellow;\n
399
+ \ }\n\n #route_table .matched_paths {\n border-bottom: solid 3px SlateGrey;\n
400
+ \ }\n\n #path_search {\n width: 80%;\n font-size: inherit;\n }\n\n
401
+ \ </style>\n\n <script>\n var toggle = function(id) {\n var s = document.getElementById(id).style;\n
402
+ \ s.display = s.display == 'none' ? 'block' : 'none';\n return false;\n
403
+ \ }\n var show = function(id) {\n document.getElementById(id).style.display
404
+ = 'block';\n }\n var hide = function(id) {\n document.getElementById(id).style.display
405
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
406
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
407
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
408
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>Routing Error</h1>\n</header>\n<div
409
+ id=\"container\">\n <h2>No route matches [POST] &quot;/api/http%3A%2F%2Flocalhost%3A3000%2Fapi%2F%252Fusers%2F&quot;</h2>\n\n
410
+ \ \n<p><code>Rails.root: /Users/austenito/repos/happiness/happiness_service</code></p>\n\n<div
411
+ id=\"traces\">\n <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
412
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
413
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
414
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
415
+ block;\">\n <pre><code></code></pre>\n </div>\n <div id=\"Framework-Trace\"
416
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
417
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
418
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
419
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
420
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
421
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
422
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
423
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
424
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
425
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
426
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
427
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
428
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
429
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
430
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
431
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
432
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in
433
+ `block in start_thread&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\"
434
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
435
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
436
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
437
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
438
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
439
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
440
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
441
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
442
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
443
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
444
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
445
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
446
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
447
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
448
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
449
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
450
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in
451
+ `block in start_thread&#39;</code></pre>\n </div>\n</div>\n\n\n <h2>\n
452
+ \ Routes\n </h2>\n\n <p>\n Routes match in priority from top
453
+ to bottom\n </p>\n\n \n<table id='route_table' class='route_table'>\n
454
+ \ <thead>\n <tr>\n <th>Helper</th>\n <th>HTTP Verb</th>\n <th>Path</th>\n
455
+ \ <th>Controller#Action</th>\n </tr>\n <tr class='bottom'>\n <th>\n
456
+ \ <a data-route-helper=\"_path\" href=\"#\" title=\"Returns a relative
457
+ path (without the http or domain)\">Path</a> /\n <a data-route-helper=\"_url\"
458
+ href=\"#\" title=\"Returns an absolute url (with the http and domain)\">Url</a>\n
459
+ \ </th>\n <th>\n </th>\n <th>\n <input id=\"path_search\"
460
+ name=\"path[]\" placeholder=\"Path Match\" type=\"search\" />\n </th>\n
461
+ \ <th>\n </th>\n </tr>\n </thead>\n <tbody class='matched_paths'
462
+ id='matched_paths'>\n </tbody>\n <tbody>\n <tr class='route_row' data-helper='path'>\n
463
+ \ <td data-route-name='api_question_survey_questions'>\n api_question_survey_questions<span
464
+ class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n GET\n
465
+ \ </td>\n <td data-route-path='/api/questions/:question_id/survey_questions(.:format)'
466
+ data-regexp='^\\/api\\/questions\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
467
+ \ /api/questions/:question_id/survey_questions(.:format)\n </td>\n <td
468
+ data-route-reqs='api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}'>\n
469
+ \ api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
470
+ class='route_row' data-helper='path'>\n <td data-route-name='api_questions'>\n
471
+ \ api_questions<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
472
+ \ GET\n </td>\n <td data-route-path='/api/questions(.:format)' data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n
473
+ \ /api/questions(.:format)\n </td>\n <td data-route-reqs='api/v1/questions#index
474
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/questions#index {:format=&gt;&quot;json&quot;}\n
475
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_questions'>\n
476
+ \ api_survey_survey_questions<span class='helper'>_path</span>\n </td>\n
477
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions(.:format)'
478
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
479
+ \ /api/surveys/:survey_id/survey_questions(.:format)\n </td>\n <td data-route-reqs='api/v1/survey_questions#create
480
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/survey_questions#create {:format=&gt;&quot;json&quot;}\n
481
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_question'>\n
482
+ \ api_survey_survey_question<span class='helper'>_path</span>\n </td>\n
483
+ \ <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
484
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
485
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
486
+ data-route-reqs='api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}'>\n
487
+ \ api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
488
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
489
+ \ <td data-route-verb='PATCH'>\n PATCH\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
490
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
491
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
492
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
493
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
494
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
495
+ \ <td data-route-verb='PUT'>\n PUT\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
496
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
497
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
498
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
499
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
500
+ class='route_row' data-helper='path'>\n <td data-route-name='api_surveys'>\n
501
+ \ api_surveys<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
502
+ \ GET\n </td>\n <td data-route-path='/api/surveys(.:format)' data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n
503
+ \ /api/surveys(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#index
504
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#index {:format=&gt;&quot;json&quot;}\n
505
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
506
+ \ </td>\n <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys(.:format)'
507
+ data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n /api/surveys(.:format)\n
508
+ \ </td>\n <td data-route-reqs='api/v1/surveys#create {:format=&gt;&quot;json&quot;}'>\n
509
+ \ api/v1/surveys#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
510
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey'>\n
511
+ \ api_survey<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
512
+ \ GET\n </td>\n <td data-route-path='/api/surveys/:id(.:format)' data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
513
+ \ /api/surveys/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#show
514
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#show {:format=&gt;&quot;json&quot;}\n
515
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_users'>\n
516
+ \ api_users<span class='helper'>_path</span>\n </td>\n <td data-route-verb='POST'>\n
517
+ \ POST\n </td>\n <td data-route-path='/api/users(.:format)' data-regexp='^\\/api\\/users(?:\\.([^\\/.?]+))?$'>\n
518
+ \ /api/users(.:format)\n </td>\n <td data-route-reqs='api/v1/users#create
519
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#create {:format=&gt;&quot;json&quot;}\n
520
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_user'>\n
521
+ \ api_user<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
522
+ \ GET\n </td>\n <td data-route-path='/api/users/:id(.:format)' data-regexp='^\\/api\\/users\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
523
+ \ /api/users/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/users#show
524
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#show {:format=&gt;&quot;json&quot;}\n
525
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='root'>\n
526
+ \ root<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
527
+ \ GET\n </td>\n <td data-route-path='/' data-regexp='^\\/$'>\n /\n
528
+ \ </td>\n <td data-route-reqs='api/v1/root#index'>\n api/v1/root#index\n
529
+ \ </td>\n</tr>\n\n </tbody>\n</table>\n\n<script type='text/javascript'>\n
530
+ \ function each(elems, func) {\n if (!elems instanceof Array) { elems =
531
+ [elems]; }\n for (var i = 0, len = elems.length; i < len; i++) {\n func(elems[i]);\n
532
+ \ }\n }\n\n function setValOn(elems, val) {\n each(elems, function(elem)
533
+ {\n elem.innerHTML = val;\n });\n }\n\n function onClick(elems,
534
+ func) {\n each(elems, function(elem) {\n elem.onclick = func;\n });\n
535
+ \ }\n\n // Enables functionality to toggle between `_path` and `_url` helper
536
+ suffixes\n function setupRouteToggleHelperLinks() {\n var toggleLinks
537
+ = document.querySelectorAll('#route_table [data-route-helper]');\n onClick(toggleLinks,
538
+ function(){\n var helperTxt = this.getAttribute(\"data-route-helper\"),\n
539
+ \ helperElems = document.querySelectorAll('[data-route-name] span.helper');\n
540
+ \ setValOn(helperElems, helperTxt);\n });\n }\n\n // takes an array
541
+ of elements with a data-regexp attribute and\n // passes their their parent
542
+ <tr> into the callback function\n // if the regexp matchs a given path\n
543
+ \ function eachElemsForPath(elems, path, func) {\n each(elems, function(e){\n
544
+ \ var reg = e.getAttribute(\"data-regexp\");\n if (path.match(RegExp(reg)))
545
+ {\n func(e.parentNode.cloneNode(true));\n }\n })\n }\n\n //
546
+ Ensure path always starts with a slash \"/\" and remove params or fragments\n
547
+ \ function sanitizePath(path) {\n var path = path.charAt(0) == '/' ? path
548
+ : \"/\" + path;\n return path.replace(/\\#.*|\\?.*/, '');\n }\n\n //
549
+ Enables path search functionality\n function setupMatchPaths() {\n var
550
+ regexpElems = document.querySelectorAll('#route_table [data-regexp]'),\n
551
+ \ pathElem = document.querySelector('#path_search'),\n selectedSection
552
+ = document.querySelector('#matched_paths'),\n noMatchText = '<tr><th
553
+ colspan=\"4\">None</th></tr>';\n\n\n // Remove matches if no path is present\n
554
+ \ pathElem.onblur = function(e) {\n if (pathElem.value === \"\") selectedSection.innerHTML
555
+ = \"\";\n }\n\n // On key press perform a search for matching paths\n
556
+ \ pathElem.onkeyup = function(e){\n var path = sanitizePath(pathElem.value),\n
557
+ \ defaultText = '<tr><th colspan=\"4\">Paths Matching (' + path +
558
+ '):</th></tr>';\n\n // Clear out results section\n selectedSection.innerHTML=
559
+ defaultText;\n\n // Display matches if they exist\n eachElemsForPath(regexpElems,
560
+ path, function(e){\n selectedSection.appendChild(e);\n });\n\n
561
+ \ // If no match present, tell the user\n if (selectedSection.innerHTML
562
+ === defaultText) {\n selectedSection.innerHTML = selectedSection.innerHTML
563
+ + noMatchText;\n }\n }\n }\n\n setupMatchPaths();\n setupRouteToggleHelperLinks();\n</script>\n\n</div>\n\n\n</body>\n</html>\n"
564
+ http_version:
565
+ recorded_at: Sat, 13 Sep 2014 15:26:49 GMT
566
+ - request:
567
+ method: post
568
+ uri: http://localhost:3000/api/%2Fusers/
569
+ body:
570
+ encoding: UTF-8
571
+ string: '{"user":{"external_user_id":42}}'
572
+ headers:
573
+ User-Agent:
574
+ - Faraday v0.9.0
575
+ Content-Type:
576
+ - application/json
577
+ Api-Token:
578
+ - testing
579
+ Accept-Encoding:
580
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
581
+ Accept:
582
+ - "*/*"
583
+ response:
584
+ status:
585
+ code: 404
586
+ message: 'Not Found '
587
+ headers:
588
+ Content-Type:
589
+ - text/html; charset=utf-8
590
+ Content-Length:
591
+ - '16582'
592
+ X-Request-Id:
593
+ - 8c788ef5-c106-4711-b8c8-ad5d435efb57
594
+ X-Runtime:
595
+ - '0.023758'
596
+ Server:
597
+ - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
598
+ Date:
599
+ - Sat, 13 Sep 2014 15:30:50 GMT
600
+ Connection:
601
+ - Keep-Alive
602
+ body:
603
+ encoding: UTF-8
604
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
605
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
606
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
607
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
608
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
609
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
610
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
611
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
612
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
613
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
614
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
615
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
616
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
617
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
618
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
619
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
620
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
621
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
622
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
623
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
624
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
625
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
626
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
627
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
628
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
629
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
630
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
631
+ { color: #C52F24; }\n\n #route_table {\n margin: 0 auto 0;\n border-collapse:
632
+ collapse;\n }\n\n #route_table td {\n padding: 0 30px;\n }\n\n #route_table
633
+ tr.bottom th {\n padding-bottom: 10px;\n line-height: 15px;\n }\n\n
634
+ \ #route_table .matched_paths {\n background-color: LightGoldenRodYellow;\n
635
+ \ }\n\n #route_table .matched_paths {\n border-bottom: solid 3px SlateGrey;\n
636
+ \ }\n\n #path_search {\n width: 80%;\n font-size: inherit;\n }\n\n
637
+ \ </style>\n\n <script>\n var toggle = function(id) {\n var s = document.getElementById(id).style;\n
638
+ \ s.display = s.display == 'none' ? 'block' : 'none';\n return false;\n
639
+ \ }\n var show = function(id) {\n document.getElementById(id).style.display
640
+ = 'block';\n }\n var hide = function(id) {\n document.getElementById(id).style.display
641
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
642
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
643
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
644
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>Routing Error</h1>\n</header>\n<div
645
+ id=\"container\">\n <h2>No route matches [POST] &quot;/api/%2Fusers&quot;</h2>\n\n
646
+ \ \n<p><code>Rails.root: /Users/austenito/repos/happiness/happiness_service</code></p>\n\n<div
647
+ id=\"traces\">\n <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
648
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
649
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
650
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
651
+ block;\">\n <pre><code></code></pre>\n </div>\n <div id=\"Framework-Trace\"
652
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
653
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
654
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
655
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
656
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
657
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
658
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
659
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
660
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
661
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
662
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
663
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
664
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
665
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
666
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
667
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
668
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in
669
+ `block in start_thread&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\"
670
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
671
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
672
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
673
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
674
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
675
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
676
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
677
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
678
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
679
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
680
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
681
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
682
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
683
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
684
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
685
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
686
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in
687
+ `block in start_thread&#39;</code></pre>\n </div>\n</div>\n\n\n <h2>\n
688
+ \ Routes\n </h2>\n\n <p>\n Routes match in priority from top
689
+ to bottom\n </p>\n\n \n<table id='route_table' class='route_table'>\n
690
+ \ <thead>\n <tr>\n <th>Helper</th>\n <th>HTTP Verb</th>\n <th>Path</th>\n
691
+ \ <th>Controller#Action</th>\n </tr>\n <tr class='bottom'>\n <th>\n
692
+ \ <a data-route-helper=\"_path\" href=\"#\" title=\"Returns a relative
693
+ path (without the http or domain)\">Path</a> /\n <a data-route-helper=\"_url\"
694
+ href=\"#\" title=\"Returns an absolute url (with the http and domain)\">Url</a>\n
695
+ \ </th>\n <th>\n </th>\n <th>\n <input id=\"path_search\"
696
+ name=\"path[]\" placeholder=\"Path Match\" type=\"search\" />\n </th>\n
697
+ \ <th>\n </th>\n </tr>\n </thead>\n <tbody class='matched_paths'
698
+ id='matched_paths'>\n </tbody>\n <tbody>\n <tr class='route_row' data-helper='path'>\n
699
+ \ <td data-route-name='api_question_survey_questions'>\n api_question_survey_questions<span
700
+ class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n GET\n
701
+ \ </td>\n <td data-route-path='/api/questions/:question_id/survey_questions(.:format)'
702
+ data-regexp='^\\/api\\/questions\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
703
+ \ /api/questions/:question_id/survey_questions(.:format)\n </td>\n <td
704
+ data-route-reqs='api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}'>\n
705
+ \ api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
706
+ class='route_row' data-helper='path'>\n <td data-route-name='api_questions'>\n
707
+ \ api_questions<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
708
+ \ GET\n </td>\n <td data-route-path='/api/questions(.:format)' data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n
709
+ \ /api/questions(.:format)\n </td>\n <td data-route-reqs='api/v1/questions#index
710
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/questions#index {:format=&gt;&quot;json&quot;}\n
711
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_questions'>\n
712
+ \ api_survey_survey_questions<span class='helper'>_path</span>\n </td>\n
713
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions(.:format)'
714
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
715
+ \ /api/surveys/:survey_id/survey_questions(.:format)\n </td>\n <td data-route-reqs='api/v1/survey_questions#create
716
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/survey_questions#create {:format=&gt;&quot;json&quot;}\n
717
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_question'>\n
718
+ \ api_survey_survey_question<span class='helper'>_path</span>\n </td>\n
719
+ \ <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
720
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
721
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
722
+ data-route-reqs='api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}'>\n
723
+ \ api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
724
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
725
+ \ <td data-route-verb='PATCH'>\n PATCH\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
726
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
727
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
728
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
729
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
730
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
731
+ \ <td data-route-verb='PUT'>\n PUT\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
732
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
733
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
734
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
735
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
736
+ class='route_row' data-helper='path'>\n <td data-route-name='api_surveys'>\n
737
+ \ api_surveys<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
738
+ \ GET\n </td>\n <td data-route-path='/api/surveys(.:format)' data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n
739
+ \ /api/surveys(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#index
740
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#index {:format=&gt;&quot;json&quot;}\n
741
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
742
+ \ </td>\n <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys(.:format)'
743
+ data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n /api/surveys(.:format)\n
744
+ \ </td>\n <td data-route-reqs='api/v1/surveys#create {:format=&gt;&quot;json&quot;}'>\n
745
+ \ api/v1/surveys#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
746
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey'>\n
747
+ \ api_survey<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
748
+ \ GET\n </td>\n <td data-route-path='/api/surveys/:id(.:format)' data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
749
+ \ /api/surveys/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#show
750
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#show {:format=&gt;&quot;json&quot;}\n
751
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_users'>\n
752
+ \ api_users<span class='helper'>_path</span>\n </td>\n <td data-route-verb='POST'>\n
753
+ \ POST\n </td>\n <td data-route-path='/api/users(.:format)' data-regexp='^\\/api\\/users(?:\\.([^\\/.?]+))?$'>\n
754
+ \ /api/users(.:format)\n </td>\n <td data-route-reqs='api/v1/users#create
755
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#create {:format=&gt;&quot;json&quot;}\n
756
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_user'>\n
757
+ \ api_user<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
758
+ \ GET\n </td>\n <td data-route-path='/api/users/:id(.:format)' data-regexp='^\\/api\\/users\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
759
+ \ /api/users/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/users#show
760
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#show {:format=&gt;&quot;json&quot;}\n
761
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='root'>\n
762
+ \ root<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
763
+ \ GET\n </td>\n <td data-route-path='/' data-regexp='^\\/$'>\n /\n
764
+ \ </td>\n <td data-route-reqs='api/v1/root#index'>\n api/v1/root#index\n
765
+ \ </td>\n</tr>\n\n </tbody>\n</table>\n\n<script type='text/javascript'>\n
766
+ \ function each(elems, func) {\n if (!elems instanceof Array) { elems =
767
+ [elems]; }\n for (var i = 0, len = elems.length; i < len; i++) {\n func(elems[i]);\n
768
+ \ }\n }\n\n function setValOn(elems, val) {\n each(elems, function(elem)
769
+ {\n elem.innerHTML = val;\n });\n }\n\n function onClick(elems,
770
+ func) {\n each(elems, function(elem) {\n elem.onclick = func;\n });\n
771
+ \ }\n\n // Enables functionality to toggle between `_path` and `_url` helper
772
+ suffixes\n function setupRouteToggleHelperLinks() {\n var toggleLinks
773
+ = document.querySelectorAll('#route_table [data-route-helper]');\n onClick(toggleLinks,
774
+ function(){\n var helperTxt = this.getAttribute(\"data-route-helper\"),\n
775
+ \ helperElems = document.querySelectorAll('[data-route-name] span.helper');\n
776
+ \ setValOn(helperElems, helperTxt);\n });\n }\n\n // takes an array
777
+ of elements with a data-regexp attribute and\n // passes their their parent
778
+ <tr> into the callback function\n // if the regexp matchs a given path\n
779
+ \ function eachElemsForPath(elems, path, func) {\n each(elems, function(e){\n
780
+ \ var reg = e.getAttribute(\"data-regexp\");\n if (path.match(RegExp(reg)))
781
+ {\n func(e.parentNode.cloneNode(true));\n }\n })\n }\n\n //
782
+ Ensure path always starts with a slash \"/\" and remove params or fragments\n
783
+ \ function sanitizePath(path) {\n var path = path.charAt(0) == '/' ? path
784
+ : \"/\" + path;\n return path.replace(/\\#.*|\\?.*/, '');\n }\n\n //
785
+ Enables path search functionality\n function setupMatchPaths() {\n var
786
+ regexpElems = document.querySelectorAll('#route_table [data-regexp]'),\n
787
+ \ pathElem = document.querySelector('#path_search'),\n selectedSection
788
+ = document.querySelector('#matched_paths'),\n noMatchText = '<tr><th
789
+ colspan=\"4\">None</th></tr>';\n\n\n // Remove matches if no path is present\n
790
+ \ pathElem.onblur = function(e) {\n if (pathElem.value === \"\") selectedSection.innerHTML
791
+ = \"\";\n }\n\n // On key press perform a search for matching paths\n
792
+ \ pathElem.onkeyup = function(e){\n var path = sanitizePath(pathElem.value),\n
793
+ \ defaultText = '<tr><th colspan=\"4\">Paths Matching (' + path +
794
+ '):</th></tr>';\n\n // Clear out results section\n selectedSection.innerHTML=
795
+ defaultText;\n\n // Display matches if they exist\n eachElemsForPath(regexpElems,
796
+ path, function(e){\n selectedSection.appendChild(e);\n });\n\n
797
+ \ // If no match present, tell the user\n if (selectedSection.innerHTML
798
+ === defaultText) {\n selectedSection.innerHTML = selectedSection.innerHTML
799
+ + noMatchText;\n }\n }\n }\n\n setupMatchPaths();\n setupRouteToggleHelperLinks();\n</script>\n\n</div>\n\n\n</body>\n</html>\n"
800
+ http_version:
801
+ recorded_at: Sat, 13 Sep 2014 15:30:50 GMT
802
+ - request:
803
+ method: post
804
+ uri: http://localhost:3000/users/
805
+ body:
806
+ encoding: UTF-8
807
+ string: '{"user":{"external_user_id":42}}'
808
+ headers:
809
+ User-Agent:
810
+ - Faraday v0.9.0
811
+ Content-Type:
812
+ - application/json
813
+ Api-Token:
814
+ - testing
815
+ Accept-Encoding:
816
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
817
+ Accept:
818
+ - "*/*"
819
+ response:
820
+ status:
821
+ code: 404
822
+ message: 'Not Found '
823
+ headers:
824
+ Content-Type:
825
+ - text/html; charset=utf-8
826
+ Content-Length:
827
+ - '16575'
828
+ X-Request-Id:
829
+ - 7d067eaf-614c-426d-884c-db5918bb28cd
830
+ X-Runtime:
831
+ - '0.018915'
832
+ Server:
833
+ - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
834
+ Date:
835
+ - Sun, 14 Sep 2014 16:59:38 GMT
836
+ Connection:
837
+ - Keep-Alive
838
+ body:
839
+ encoding: UTF-8
840
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
841
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
842
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
843
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
844
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
845
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
846
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
847
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
848
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
849
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
850
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
851
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
852
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
853
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
854
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
855
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
856
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
857
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
858
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
859
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
860
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
861
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
862
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
863
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
864
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
865
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
866
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
867
+ { color: #C52F24; }\n\n #route_table {\n margin: 0 auto 0;\n border-collapse:
868
+ collapse;\n }\n\n #route_table td {\n padding: 0 30px;\n }\n\n #route_table
869
+ tr.bottom th {\n padding-bottom: 10px;\n line-height: 15px;\n }\n\n
870
+ \ #route_table .matched_paths {\n background-color: LightGoldenRodYellow;\n
871
+ \ }\n\n #route_table .matched_paths {\n border-bottom: solid 3px SlateGrey;\n
872
+ \ }\n\n #path_search {\n width: 80%;\n font-size: inherit;\n }\n\n
873
+ \ </style>\n\n <script>\n var toggle = function(id) {\n var s = document.getElementById(id).style;\n
874
+ \ s.display = s.display == 'none' ? 'block' : 'none';\n return false;\n
875
+ \ }\n var show = function(id) {\n document.getElementById(id).style.display
876
+ = 'block';\n }\n var hide = function(id) {\n document.getElementById(id).style.display
877
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
878
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
879
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
880
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>Routing Error</h1>\n</header>\n<div
881
+ id=\"container\">\n <h2>No route matches [POST] &quot;/users&quot;</h2>\n\n
882
+ \ \n<p><code>Rails.root: /Users/austenito/repos/happiness/happiness_service</code></p>\n\n<div
883
+ id=\"traces\">\n <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
884
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
885
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
886
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
887
+ block;\">\n <pre><code></code></pre>\n </div>\n <div id=\"Framework-Trace\"
888
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
889
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
890
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
891
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
892
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
893
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
894
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
895
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
896
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
897
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
898
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
899
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
900
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
901
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
902
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
903
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
904
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in
905
+ `block in start_thread&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\"
906
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
907
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
908
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
909
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
910
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
911
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
912
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
913
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
914
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
915
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
916
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
917
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
918
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
919
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
920
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
921
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
922
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in
923
+ `block in start_thread&#39;</code></pre>\n </div>\n</div>\n\n\n <h2>\n
924
+ \ Routes\n </h2>\n\n <p>\n Routes match in priority from top
925
+ to bottom\n </p>\n\n \n<table id='route_table' class='route_table'>\n
926
+ \ <thead>\n <tr>\n <th>Helper</th>\n <th>HTTP Verb</th>\n <th>Path</th>\n
927
+ \ <th>Controller#Action</th>\n </tr>\n <tr class='bottom'>\n <th>\n
928
+ \ <a data-route-helper=\"_path\" href=\"#\" title=\"Returns a relative
929
+ path (without the http or domain)\">Path</a> /\n <a data-route-helper=\"_url\"
930
+ href=\"#\" title=\"Returns an absolute url (with the http and domain)\">Url</a>\n
931
+ \ </th>\n <th>\n </th>\n <th>\n <input id=\"path_search\"
932
+ name=\"path[]\" placeholder=\"Path Match\" type=\"search\" />\n </th>\n
933
+ \ <th>\n </th>\n </tr>\n </thead>\n <tbody class='matched_paths'
934
+ id='matched_paths'>\n </tbody>\n <tbody>\n <tr class='route_row' data-helper='path'>\n
935
+ \ <td data-route-name='api_question_survey_questions'>\n api_question_survey_questions<span
936
+ class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n GET\n
937
+ \ </td>\n <td data-route-path='/api/questions/:question_id/survey_questions(.:format)'
938
+ data-regexp='^\\/api\\/questions\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
939
+ \ /api/questions/:question_id/survey_questions(.:format)\n </td>\n <td
940
+ data-route-reqs='api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}'>\n
941
+ \ api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
942
+ class='route_row' data-helper='path'>\n <td data-route-name='api_questions'>\n
943
+ \ api_questions<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
944
+ \ GET\n </td>\n <td data-route-path='/api/questions(.:format)' data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n
945
+ \ /api/questions(.:format)\n </td>\n <td data-route-reqs='api/v1/questions#index
946
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/questions#index {:format=&gt;&quot;json&quot;}\n
947
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_questions'>\n
948
+ \ api_survey_survey_questions<span class='helper'>_path</span>\n </td>\n
949
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions(.:format)'
950
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
951
+ \ /api/surveys/:survey_id/survey_questions(.:format)\n </td>\n <td data-route-reqs='api/v1/survey_questions#create
952
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/survey_questions#create {:format=&gt;&quot;json&quot;}\n
953
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_question'>\n
954
+ \ api_survey_survey_question<span class='helper'>_path</span>\n </td>\n
955
+ \ <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
956
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
957
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
958
+ data-route-reqs='api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}'>\n
959
+ \ api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
960
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
961
+ \ <td data-route-verb='PATCH'>\n PATCH\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
962
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
963
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
964
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
965
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
966
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
967
+ \ <td data-route-verb='PUT'>\n PUT\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
968
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
969
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
970
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
971
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
972
+ class='route_row' data-helper='path'>\n <td data-route-name='api_surveys'>\n
973
+ \ api_surveys<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
974
+ \ GET\n </td>\n <td data-route-path='/api/surveys(.:format)' data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n
975
+ \ /api/surveys(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#index
976
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#index {:format=&gt;&quot;json&quot;}\n
977
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
978
+ \ </td>\n <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys(.:format)'
979
+ data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n /api/surveys(.:format)\n
980
+ \ </td>\n <td data-route-reqs='api/v1/surveys#create {:format=&gt;&quot;json&quot;}'>\n
981
+ \ api/v1/surveys#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
982
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey'>\n
983
+ \ api_survey<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
984
+ \ GET\n </td>\n <td data-route-path='/api/surveys/:id(.:format)' data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
985
+ \ /api/surveys/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#show
986
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#show {:format=&gt;&quot;json&quot;}\n
987
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_users'>\n
988
+ \ api_users<span class='helper'>_path</span>\n </td>\n <td data-route-verb='POST'>\n
989
+ \ POST\n </td>\n <td data-route-path='/api/users(.:format)' data-regexp='^\\/api\\/users(?:\\.([^\\/.?]+))?$'>\n
990
+ \ /api/users(.:format)\n </td>\n <td data-route-reqs='api/v1/users#create
991
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#create {:format=&gt;&quot;json&quot;}\n
992
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_user'>\n
993
+ \ api_user<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
994
+ \ GET\n </td>\n <td data-route-path='/api/users/:id(.:format)' data-regexp='^\\/api\\/users\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
995
+ \ /api/users/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/users#show
996
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#show {:format=&gt;&quot;json&quot;}\n
997
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='root'>\n
998
+ \ root<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
999
+ \ GET\n </td>\n <td data-route-path='/' data-regexp='^\\/$'>\n /\n
1000
+ \ </td>\n <td data-route-reqs='api/v1/root#index'>\n api/v1/root#index\n
1001
+ \ </td>\n</tr>\n\n </tbody>\n</table>\n\n<script type='text/javascript'>\n
1002
+ \ function each(elems, func) {\n if (!elems instanceof Array) { elems =
1003
+ [elems]; }\n for (var i = 0, len = elems.length; i < len; i++) {\n func(elems[i]);\n
1004
+ \ }\n }\n\n function setValOn(elems, val) {\n each(elems, function(elem)
1005
+ {\n elem.innerHTML = val;\n });\n }\n\n function onClick(elems,
1006
+ func) {\n each(elems, function(elem) {\n elem.onclick = func;\n });\n
1007
+ \ }\n\n // Enables functionality to toggle between `_path` and `_url` helper
1008
+ suffixes\n function setupRouteToggleHelperLinks() {\n var toggleLinks
1009
+ = document.querySelectorAll('#route_table [data-route-helper]');\n onClick(toggleLinks,
1010
+ function(){\n var helperTxt = this.getAttribute(\"data-route-helper\"),\n
1011
+ \ helperElems = document.querySelectorAll('[data-route-name] span.helper');\n
1012
+ \ setValOn(helperElems, helperTxt);\n });\n }\n\n // takes an array
1013
+ of elements with a data-regexp attribute and\n // passes their their parent
1014
+ <tr> into the callback function\n // if the regexp matchs a given path\n
1015
+ \ function eachElemsForPath(elems, path, func) {\n each(elems, function(e){\n
1016
+ \ var reg = e.getAttribute(\"data-regexp\");\n if (path.match(RegExp(reg)))
1017
+ {\n func(e.parentNode.cloneNode(true));\n }\n })\n }\n\n //
1018
+ Ensure path always starts with a slash \"/\" and remove params or fragments\n
1019
+ \ function sanitizePath(path) {\n var path = path.charAt(0) == '/' ? path
1020
+ : \"/\" + path;\n return path.replace(/\\#.*|\\?.*/, '');\n }\n\n //
1021
+ Enables path search functionality\n function setupMatchPaths() {\n var
1022
+ regexpElems = document.querySelectorAll('#route_table [data-regexp]'),\n
1023
+ \ pathElem = document.querySelector('#path_search'),\n selectedSection
1024
+ = document.querySelector('#matched_paths'),\n noMatchText = '<tr><th
1025
+ colspan=\"4\">None</th></tr>';\n\n\n // Remove matches if no path is present\n
1026
+ \ pathElem.onblur = function(e) {\n if (pathElem.value === \"\") selectedSection.innerHTML
1027
+ = \"\";\n }\n\n // On key press perform a search for matching paths\n
1028
+ \ pathElem.onkeyup = function(e){\n var path = sanitizePath(pathElem.value),\n
1029
+ \ defaultText = '<tr><th colspan=\"4\">Paths Matching (' + path +
1030
+ '):</th></tr>';\n\n // Clear out results section\n selectedSection.innerHTML=
1031
+ defaultText;\n\n // Display matches if they exist\n eachElemsForPath(regexpElems,
1032
+ path, function(e){\n selectedSection.appendChild(e);\n });\n\n
1033
+ \ // If no match present, tell the user\n if (selectedSection.innerHTML
1034
+ === defaultText) {\n selectedSection.innerHTML = selectedSection.innerHTML
1035
+ + noMatchText;\n }\n }\n }\n\n setupMatchPaths();\n setupRouteToggleHelperLinks();\n</script>\n\n</div>\n\n\n</body>\n</html>\n"
1036
+ http_version:
1037
+ recorded_at: Sun, 14 Sep 2014 16:59:38 GMT
1038
+ - request:
1039
+ method: post
1040
+ uri: http://localhost:3000/api/users/
1041
+ body:
1042
+ encoding: UTF-8
1043
+ string: "{}"
1044
+ headers:
1045
+ User-Agent:
1046
+ - Faraday v0.9.0
1047
+ Content-Type:
1048
+ - application/json
1049
+ Api-Token:
1050
+ - testing
1051
+ Accept-Encoding:
1052
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1053
+ Accept:
1054
+ - "*/*"
1055
+ response:
1056
+ status:
1057
+ code: 201
1058
+ message: 'Created '
1059
+ headers:
1060
+ X-Frame-Options:
1061
+ - SAMEORIGIN
1062
+ X-Xss-Protection:
1063
+ - 1; mode=block
1064
+ X-Content-Type-Options:
1065
+ - nosniff
1066
+ X-Ua-Compatible:
1067
+ - chrome=1
1068
+ Content-Type:
1069
+ - application/json; charset=utf-8
1070
+ Etag:
1071
+ - '"a8f199bc6caa5fff3d3449c465eabfea"'
1072
+ Cache-Control:
1073
+ - max-age=0, private, must-revalidate
1074
+ X-Request-Id:
1075
+ - 7eeafa78-636e-4805-ad42-b5991318b0f9
1076
+ X-Runtime:
1077
+ - '0.006511'
1078
+ Server:
1079
+ - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
1080
+ Date:
1081
+ - Sat, 20 Sep 2014 14:14:34 GMT
1082
+ Content-Length:
1083
+ - '272'
1084
+ Connection:
1085
+ - Keep-Alive
1086
+ body:
1087
+ encoding: UTF-8
1088
+ string: |-
1089
+ {
1090
+ "id": 12,
1091
+ "service_user_id": "3aa49be2db36a85fe4c6b19e6345c8379836716ee035c972e748c7c71195864c",
1092
+ "_links": {
1093
+ "self": {
1094
+ "href": "http://localhost:3000/api/users/12"
1095
+ }
1096
+ },
1097
+ "token": "2965f424f516ad23160aecf4bb6c9131c31439a129a976981237b1b0fbd8754b"
1098
+ }
1099
+ http_version:
1100
+ recorded_at: Sat, 20 Sep 2014 14:14:34 GMT
1101
+ - request:
1102
+ method: post
1103
+ uri: http://localhost:3000/api/surveys/?random=true
1104
+ body:
1105
+ encoding: UTF-8
1106
+ string: '{"survey":{"user_id":12}}'
1107
+ headers:
1108
+ User-Agent:
1109
+ - Faraday v0.9.0
1110
+ Content-Type:
1111
+ - application/json
1112
+ Api-Token:
1113
+ - testing
1114
+ Accept-Encoding:
1115
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1116
+ Accept:
1117
+ - "*/*"
1118
+ response:
1119
+ status:
1120
+ code: 201
1121
+ message: 'Created '
1122
+ headers:
1123
+ X-Frame-Options:
1124
+ - SAMEORIGIN
1125
+ X-Xss-Protection:
1126
+ - 1; mode=block
1127
+ X-Content-Type-Options:
1128
+ - nosniff
1129
+ X-Ua-Compatible:
1130
+ - chrome=1
1131
+ Content-Type:
1132
+ - application/json; charset=utf-8
1133
+ Etag:
1134
+ - '"8d698a52db0f4c5b310716c034a655e3"'
1135
+ Cache-Control:
1136
+ - max-age=0, private, must-revalidate
1137
+ X-Request-Id:
1138
+ - 48bcc608-571e-488e-85af-ec24f2f6d832
1139
+ X-Runtime:
1140
+ - '0.039988'
1141
+ Server:
1142
+ - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
1143
+ Date:
1144
+ - Sat, 20 Sep 2014 14:14:34 GMT
1145
+ Content-Length:
1146
+ - '4487'
1147
+ Connection:
1148
+ - Keep-Alive
1149
+ body:
1150
+ encoding: UTF-8
1151
+ string: |-
1152
+ {
1153
+ "id": 12,
1154
+ "user_id": 12,
1155
+ "_links": {
1156
+ "self": {
1157
+ "href": "http://localhost:3000/api/surveys/12"
301
1158
  },
1159
+ "survey_questions": {
1160
+ "post": {
1161
+ "href": "/api/surveys/12/survey_questions"
1162
+ },
1163
+ "put": {
1164
+ "href": "/api/surveys/12/survey_questions"
1165
+ }
1166
+ }
1167
+ },
1168
+ "completed": false,
1169
+ "survey_questions": [
302
1170
  {
303
- "id": 1005,
304
- "text": "To what extent do you feel accepted by the person/people you are interacting with?",
1171
+ "id": 30,
1172
+ "text": "How do you feel right now?",
305
1173
  "type": "range",
306
1174
  "responses": [
307
1175
  "0",
@@ -311,46 +1179,176 @@ http_interactions:
311
1179
  "freeform": false,
312
1180
  "_links": {
313
1181
  "self": {
314
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1005"
1182
+ "href": "/api/surveys/12/survey_questions/30"
1183
+ },
1184
+ "post": {
1185
+ "href": "http://localhost:3000/api/surveys/12/survey_questions"
1186
+ },
1187
+ "put": {
1188
+ "href": "/api/surveys/12/survey_questions/30"
315
1189
  },
316
1190
  "survey": {
317
- "href": "http://localhost:3000/api/surveys/275"
1191
+ "href": "/api/surveys/12"
1192
+ }
1193
+ }
1194
+ },
1195
+ {
1196
+ "id": 31,
1197
+ "text": "Where are you?",
1198
+ "type": "multiple",
1199
+ "responses": [
1200
+ "At Home",
1201
+ "At Work",
1202
+ "In a car",
1203
+ "Other"
1204
+ ],
1205
+ "answer": null,
1206
+ "freeform": true,
1207
+ "_links": {
1208
+ "self": {
1209
+ "href": "/api/surveys/12/survey_questions/31"
318
1210
  },
319
- "create": {
320
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
1211
+ "post": {
1212
+ "href": "http://localhost:3000/api/surveys/12/survey_questions"
321
1213
  },
322
- "submit": {
323
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1005"
1214
+ "put": {
1215
+ "href": "/api/surveys/12/survey_questions/31"
1216
+ },
1217
+ "survey": {
1218
+ "href": "/api/surveys/12"
324
1219
  }
325
1220
  }
326
1221
  },
327
1222
  {
328
- "id": 1006,
329
- "text": "How well did you sleep last night?",
330
- "type": "range",
1223
+ "id": 32,
1224
+ "text": "Who are you talking or interacting with?",
1225
+ "type": "multiple",
1226
+ "responses": [
1227
+ "Spouse/partner/significant other",
1228
+ "Children",
1229
+ "Parents",
1230
+ "Other relatives",
1231
+ "Friends",
1232
+ "Acquaintances",
1233
+ "Strangers",
1234
+ "Co-workers",
1235
+ "Customers/students",
1236
+ "Boss",
1237
+ "No one"
1238
+ ],
1239
+ "answer": null,
1240
+ "freeform": true,
1241
+ "_links": {
1242
+ "self": {
1243
+ "href": "/api/surveys/12/survey_questions/32"
1244
+ },
1245
+ "post": {
1246
+ "href": "http://localhost:3000/api/surveys/12/survey_questions"
1247
+ },
1248
+ "put": {
1249
+ "href": "/api/surveys/12/survey_questions/32"
1250
+ },
1251
+ "survey": {
1252
+ "href": "/api/surveys/12"
1253
+ }
1254
+ }
1255
+ },
1256
+ {
1257
+ "id": 33,
1258
+ "text": "How many people are you talking or interacting with?",
1259
+ "type": "multiple",
331
1260
  "responses": [
332
1261
  "0",
1262
+ "1",
1263
+ "2",
1264
+ "3",
1265
+ "4",
1266
+ "5",
1267
+ "6",
1268
+ "7",
1269
+ "8",
1270
+ "9",
1271
+ "10",
1272
+ "More than 10"
1273
+ ],
1274
+ "answer": null,
1275
+ "freeform": false,
1276
+ "_links": {
1277
+ "self": {
1278
+ "href": "/api/surveys/12/survey_questions/33"
1279
+ },
1280
+ "post": {
1281
+ "href": "http://localhost:3000/api/surveys/12/survey_questions"
1282
+ },
1283
+ "put": {
1284
+ "href": "/api/surveys/12/survey_questions/33"
1285
+ },
1286
+ "survey": {
1287
+ "href": "/api/surveys/12"
1288
+ }
1289
+ }
1290
+ },
1291
+ {
1292
+ "id": 34,
1293
+ "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?",
1294
+ "type": "multiple",
1295
+ "responses": [
1296
+ "0",
1297
+ "1",
1298
+ "2",
1299
+ "3",
1300
+ "4",
1301
+ "5",
1302
+ "6",
1303
+ "7",
1304
+ "8",
1305
+ "9",
333
1306
  "10"
334
1307
  ],
335
1308
  "answer": null,
336
1309
  "freeform": false,
337
1310
  "_links": {
338
1311
  "self": {
339
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1006"
1312
+ "href": "/api/surveys/12/survey_questions/34"
1313
+ },
1314
+ "post": {
1315
+ "href": "http://localhost:3000/api/surveys/12/survey_questions"
1316
+ },
1317
+ "put": {
1318
+ "href": "/api/surveys/12/survey_questions/34"
340
1319
  },
341
1320
  "survey": {
342
- "href": "http://localhost:3000/api/surveys/275"
1321
+ "href": "/api/surveys/12"
1322
+ }
1323
+ }
1324
+ },
1325
+ {
1326
+ "id": 35,
1327
+ "text": "To what extent do you feel accepted by the person/people you are interacting with?",
1328
+ "type": "range",
1329
+ "responses": [
1330
+ "0",
1331
+ "10"
1332
+ ],
1333
+ "answer": null,
1334
+ "freeform": false,
1335
+ "_links": {
1336
+ "self": {
1337
+ "href": "/api/surveys/12/survey_questions/35"
343
1338
  },
344
- "create": {
345
- "href": "http://localhost:3000/api/surveys/275/survey_questions"
1339
+ "post": {
1340
+ "href": "http://localhost:3000/api/surveys/12/survey_questions"
346
1341
  },
347
- "submit": {
348
- "href": "http://localhost:3000/api/surveys/275/survey_questions/1006"
1342
+ "put": {
1343
+ "href": "/api/surveys/12/survey_questions/35"
1344
+ },
1345
+ "survey": {
1346
+ "href": "/api/surveys/12"
349
1347
  }
350
1348
  }
351
1349
  }
352
1350
  ]
353
1351
  }
354
1352
  http_version:
355
- recorded_at: Sat, 05 Jul 2014 21:24:17 GMT
1353
+ recorded_at: Sat, 20 Sep 2014 14:14:34 GMT
356
1354
  recorded_with: VCR 2.6.0