poptart 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/lib/poptart.rb +1 -4
  4. data/lib/poptart/link.rb +9 -0
  5. data/lib/poptart/model.rb +13 -29
  6. data/lib/poptart/question.rb +21 -17
  7. data/lib/poptart/root.rb +10 -1
  8. data/lib/poptart/survey.rb +34 -7
  9. data/lib/poptart/survey_question.rb +32 -12
  10. data/lib/poptart/user.rb +4 -21
  11. data/lib/version.rb +1 -1
  12. data/poptart.gemspec +0 -4
  13. data/spec/lib/poptart/model_spec.rb +95 -0
  14. data/spec/lib/poptart/question_spec.rb +47 -0
  15. data/spec/lib/poptart/root_spec.rb +50 -0
  16. data/spec/lib/poptart/survey_question_spec.rb +166 -0
  17. data/spec/lib/poptart/survey_spec.rb +105 -0
  18. data/spec/lib/poptart/user_spec.rb +45 -0
  19. data/spec/requests/questions_spec.rb +31 -0
  20. data/spec/requests/survey_questions_spec.rb +150 -0
  21. data/spec/requests/surveys_spec.rb +34 -5
  22. data/spec/requests/{user_management_spec.rb → users_spec.rb} +5 -5
  23. data/spec/spec_helper.rb +1 -4
  24. data/spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml +1527 -1596
  25. data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +2942 -2035
  26. data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +254 -70
  27. data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +110 -48
  28. data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +1618 -286
  29. data/spec/vcr/poptart/survey/adds_a_question_to_a_survey.yml +1939 -0
  30. data/spec/vcr/poptart/survey/creates_a_random_survey.yml +318 -0
  31. data/spec/vcr/poptart/survey/creates_an_empty_survey.yml +702 -0
  32. data/spec/vcr/poptart/survey/returns_a_survey_by_id.yml +618 -0
  33. data/spec/vcr/poptart/user/creates_a_user.yml +179 -0
  34. data/spec/vcr/{user/management_creates_a_user.yml → poptart/user/returns_a_user.yml} +72 -69
  35. data/spec/vcr/questions/creates_a_question.yml +186 -0
  36. data/spec/vcr/questions/finds_a_question_by_id.yml +326 -0
  37. data/spec/vcr/questions/finds_a_question_by_key.yml +144 -0
  38. data/spec/vcr/questions/returns_all_answered_survey_questions_for_a_question.yml +1021 -0
  39. data/spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml +533 -479
  40. data/spec/vcr/survey/questions_answers_a_multiple_choice_question.yml +1454 -0
  41. data/spec/vcr/survey/questions_answers_a_survey_question.yml +1772 -0
  42. data/spec/vcr/survey/questions_creates_and_returns_an_empty_survey.yml +372 -0
  43. data/spec/vcr/survey/questions_finds_survey_question_for_id.yml +3083 -0
  44. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question.yml +5756 -0
  45. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question_by_key.yml +973 -0
  46. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_survey.yml +620 -0
  47. metadata +55 -72
  48. data/lib/poptart/boolean_question.rb +0 -14
  49. data/lib/poptart/multiple_response_question.rb +0 -9
  50. data/lib/poptart/range_question.rb +0 -9
  51. data/lib/poptart/time_question.rb +0 -9
  52. data/spec/requests/answering_survey_questions_spec.rb +0 -79
  53. data/spec/requests/answers_spec.rb +0 -45
  54. data/spec/requests/creating_questions_spec.rb +0 -30
@@ -0,0 +1,318 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/users
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/json
14
+ Api-Token:
15
+ - testing
16
+ User-Token:
17
+ - 78758fa0b6cbc73f43f7c185d630d53cf7bd6c4020069b3f381b4a7a7908b55e
18
+ Service-User-Id:
19
+ - 9d37fe86d9f38d0ec2fcfa66b2eac63fe146fb926bf193e95d9f8edafd5303c4
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Accept:
23
+ - "*/*"
24
+ response:
25
+ status:
26
+ code: 404
27
+ message: 'Not Found '
28
+ headers:
29
+ Content-Type:
30
+ - text/html; charset=utf-8
31
+ Content-Length:
32
+ - '17312'
33
+ X-Request-Id:
34
+ - b559f37d-e30b-424d-97b5-c4bd7d935c39
35
+ X-Runtime:
36
+ - '0.050615'
37
+ Server:
38
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
39
+ Date:
40
+ - Sun, 04 Jan 2015 13:57:31 GMT
41
+ Connection:
42
+ - Keep-Alive
43
+ body:
44
+ encoding: UTF-8
45
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
46
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
47
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
48
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
49
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
50
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
51
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
52
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
53
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
54
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
55
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
56
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
57
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
58
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
59
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
60
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
61
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
62
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
63
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
64
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
65
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
66
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
67
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
68
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
69
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
70
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
71
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
72
+ { color: #C52F24; }\n\n #route_table {\n margin: 0 auto 0;\n border-collapse:
73
+ collapse;\n }\n\n #route_table td {\n padding: 0 30px;\n }\n\n #route_table
74
+ tr.bottom th {\n padding-bottom: 10px;\n line-height: 15px;\n }\n\n
75
+ \ #route_table .matched_paths {\n background-color: LightGoldenRodYellow;\n
76
+ \ }\n\n #route_table .matched_paths {\n border-bottom: solid 3px SlateGrey;\n
77
+ \ }\n\n #path_search {\n width: 80%;\n font-size: inherit;\n }\n\n
78
+ \ </style>\n\n <script>\n var toggle = function(id) {\n var s = document.getElementById(id).style;\n
79
+ \ s.display = s.display == 'none' ? 'block' : 'none';\n return false;\n
80
+ \ }\n var show = function(id) {\n document.getElementById(id).style.display
81
+ = 'block';\n }\n var hide = function(id) {\n document.getElementById(id).style.display
82
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
83
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
84
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
85
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>Routing Error</h1>\n</header>\n<div
86
+ id=\"container\">\n <h2>No route matches [POST] &quot;/api/users&quot;</h2>\n\n
87
+ \ \n<p><code>Rails.root: /Users/austenito/repos/happiness/happiness_service</code></p>\n\n<div
88
+ id=\"traces\">\n <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
89
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
90
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
91
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
92
+ block;\">\n <pre><code></code></pre>\n </div>\n <div id=\"Framework-Trace\"
93
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
94
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
95
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
96
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
97
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
98
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
99
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
100
+ (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
101
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
102
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
103
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
104
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
105
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
106
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
107
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
108
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
109
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in
110
+ `block in start_thread&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\"
111
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
112
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
113
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
114
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
115
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
116
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
117
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
118
+ (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
119
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
120
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
121
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
122
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
123
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
124
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
125
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
126
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
127
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in
128
+ `block in start_thread&#39;</code></pre>\n </div>\n</div>\n\n\n <h2>\n
129
+ \ Routes\n </h2>\n\n <p>\n Routes match in priority from top
130
+ to bottom\n </p>\n\n \n<table id='route_table' class='route_table'>\n
131
+ \ <thead>\n <tr>\n <th>Helper</th>\n <th>HTTP Verb</th>\n <th>Path</th>\n
132
+ \ <th>Controller#Action</th>\n </tr>\n <tr class='bottom'>\n <th>\n
133
+ \ <a data-route-helper=\"_path\" href=\"#\" title=\"Returns a relative
134
+ path (without the http or domain)\">Path</a> /\n <a data-route-helper=\"_url\"
135
+ href=\"#\" title=\"Returns an absolute url (with the http and domain)\">Url</a>\n
136
+ \ </th>\n <th>\n </th>\n <th>\n <input id=\"path_search\"
137
+ name=\"path[]\" placeholder=\"Path Match\" type=\"search\" />\n </th>\n
138
+ \ <th>\n </th>\n </tr>\n </thead>\n <tbody class='matched_paths'
139
+ id='matched_paths'>\n </tbody>\n <tbody>\n <tr class='route_row' data-helper='path'>\n
140
+ \ <td data-route-name='api_questions'>\n api_questions<span class='helper'>_path</span>\n
141
+ \ </td>\n <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/questions(.:format)'
142
+ data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n /api/questions(.:format)\n
143
+ \ </td>\n <td data-route-reqs='api/v1/questions#index {:format=&gt;&quot;json&quot;}'>\n
144
+ \ api/v1/questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
145
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
146
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/questions(.:format)'
147
+ data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n /api/questions(.:format)\n
148
+ \ </td>\n <td data-route-reqs='api/v1/questions#create {:format=&gt;&quot;json&quot;}'>\n
149
+ \ api/v1/questions#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
150
+ class='route_row' data-helper='path'>\n <td data-route-name='api_question'>\n
151
+ \ api_question<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
152
+ \ GET\n </td>\n <td data-route-path='/api/questions/:id(.:format)' data-regexp='^\\/api\\/questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
153
+ \ /api/questions/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/questions#show
154
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/questions#show {:format=&gt;&quot;json&quot;}\n
155
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_questions'>\n
156
+ \ api_survey_questions<span class='helper'>_path</span>\n </td>\n <td
157
+ data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/survey_questions(.:format)'
158
+ data-regexp='^\\/api\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n /api/survey_questions(.:format)\n
159
+ \ </td>\n <td data-route-reqs='api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}'>\n
160
+ \ api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
161
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_questions'>\n
162
+ \ api_survey_survey_questions<span class='helper'>_path</span>\n </td>\n
163
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions(.:format)'
164
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
165
+ \ /api/surveys/:survey_id/survey_questions(.:format)\n </td>\n <td data-route-reqs='api/v1/survey_questions#create
166
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/survey_questions#create {:format=&gt;&quot;json&quot;}\n
167
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_question'>\n
168
+ \ api_survey_survey_question<span class='helper'>_path</span>\n </td>\n
169
+ \ <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
170
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
171
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
172
+ data-route-reqs='api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}'>\n
173
+ \ api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
174
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
175
+ \ <td data-route-verb='PATCH'>\n PATCH\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
176
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
177
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
178
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
179
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
180
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
181
+ \ <td data-route-verb='PUT'>\n PUT\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
182
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
183
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
184
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
185
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
186
+ class='route_row' data-helper='path'>\n <td data-route-name='api_surveys'>\n
187
+ \ api_surveys<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
188
+ \ GET\n </td>\n <td data-route-path='/api/surveys(.:format)' data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n
189
+ \ /api/surveys(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#index
190
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#index {:format=&gt;&quot;json&quot;}\n
191
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
192
+ \ </td>\n <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys(.:format)'
193
+ data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n /api/surveys(.:format)\n
194
+ \ </td>\n <td data-route-reqs='api/v1/surveys#create {:format=&gt;&quot;json&quot;}'>\n
195
+ \ api/v1/surveys#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
196
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey'>\n
197
+ \ api_survey<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
198
+ \ GET\n </td>\n <td data-route-path='/api/surveys/:id(.:format)' data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
199
+ \ /api/surveys/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#show
200
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#show {:format=&gt;&quot;json&quot;}\n
201
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_user'>\n
202
+ \ api_user<span class='helper'>_path</span>\n </td>\n <td data-route-verb='POST'>\n
203
+ \ POST\n </td>\n <td data-route-path='/api/user(.:format)' data-regexp='^\\/api\\/user(?:\\.([^\\/.?]+))?$'>\n
204
+ \ /api/user(.:format)\n </td>\n <td data-route-reqs='api/v1/users#create
205
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#create {:format=&gt;&quot;json&quot;}\n
206
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
207
+ \ </td>\n <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/user(.:format)'
208
+ data-regexp='^\\/api\\/user(?:\\.([^\\/.?]+))?$'>\n /api/user(.:format)\n
209
+ \ </td>\n <td data-route-reqs='api/v1/users#show {:format=&gt;&quot;json&quot;}'>\n
210
+ \ api/v1/users#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
211
+ class='route_row' data-helper='path'>\n <td data-route-name='root'>\n root<span
212
+ class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n GET\n
213
+ \ </td>\n <td data-route-path='/' data-regexp='^\\/$'>\n /\n </td>\n
214
+ \ <td data-route-reqs='api/v1/root#index'>\n api/v1/root#index\n </td>\n</tr>\n\n
215
+ \ </tbody>\n</table>\n\n<script type='text/javascript'>\n function each(elems,
216
+ func) {\n if (!elems instanceof Array) { elems = [elems]; }\n for (var
217
+ i = 0, len = elems.length; i < len; i++) {\n func(elems[i]);\n }\n
218
+ \ }\n\n function setValOn(elems, val) {\n each(elems, function(elem) {\n
219
+ \ elem.innerHTML = val;\n });\n }\n\n function onClick(elems, func)
220
+ {\n each(elems, function(elem) {\n elem.onclick = func;\n });\n
221
+ \ }\n\n // Enables functionality to toggle between `_path` and `_url` helper
222
+ suffixes\n function setupRouteToggleHelperLinks() {\n var toggleLinks
223
+ = document.querySelectorAll('#route_table [data-route-helper]');\n onClick(toggleLinks,
224
+ function(){\n var helperTxt = this.getAttribute(\"data-route-helper\"),\n
225
+ \ helperElems = document.querySelectorAll('[data-route-name] span.helper');\n
226
+ \ setValOn(helperElems, helperTxt);\n });\n }\n\n // takes an array
227
+ of elements with a data-regexp attribute and\n // passes their their parent
228
+ <tr> into the callback function\n // if the regexp matchs a given path\n
229
+ \ function eachElemsForPath(elems, path, func) {\n each(elems, function(e){\n
230
+ \ var reg = e.getAttribute(\"data-regexp\");\n if (path.match(RegExp(reg)))
231
+ {\n func(e.parentNode.cloneNode(true));\n }\n })\n }\n\n //
232
+ Ensure path always starts with a slash \"/\" and remove params or fragments\n
233
+ \ function sanitizePath(path) {\n var path = path.charAt(0) == '/' ? path
234
+ : \"/\" + path;\n return path.replace(/\\#.*|\\?.*/, '');\n }\n\n //
235
+ Enables path search functionality\n function setupMatchPaths() {\n var
236
+ regexpElems = document.querySelectorAll('#route_table [data-regexp]'),\n
237
+ \ pathElem = document.querySelector('#path_search'),\n selectedSection
238
+ = document.querySelector('#matched_paths'),\n noMatchText = '<tr><th
239
+ colspan=\"4\">None</th></tr>';\n\n\n // Remove matches if no path is present\n
240
+ \ pathElem.onblur = function(e) {\n if (pathElem.value === \"\") selectedSection.innerHTML
241
+ = \"\";\n }\n\n // On key press perform a search for matching paths\n
242
+ \ pathElem.onkeyup = function(e){\n var path = sanitizePath(pathElem.value),\n
243
+ \ defaultText = '<tr><th colspan=\"4\">Paths Matching (' + path +
244
+ '):</th></tr>';\n\n // Clear out results section\n selectedSection.innerHTML=
245
+ defaultText;\n\n // Display matches if they exist\n eachElemsForPath(regexpElems,
246
+ path, function(e){\n selectedSection.appendChild(e);\n });\n\n
247
+ \ // If no match present, tell the user\n if (selectedSection.innerHTML
248
+ === defaultText) {\n selectedSection.innerHTML = selectedSection.innerHTML
249
+ + noMatchText;\n }\n }\n }\n\n setupMatchPaths();\n setupRouteToggleHelperLinks();\n</script>\n\n</div>\n\n\n</body>\n</html>\n"
250
+ http_version:
251
+ recorded_at: Sun, 04 Jan 2015 13:57:31 GMT
252
+ - request:
253
+ method: post
254
+ uri: http://localhost:3000/api/user
255
+ body:
256
+ encoding: UTF-8
257
+ string: "{}"
258
+ headers:
259
+ User-Agent:
260
+ - Faraday v0.9.0
261
+ Content-Type:
262
+ - application/json
263
+ Api-Token:
264
+ - testing
265
+ User-Token:
266
+ - 5d6eaa09a0131d7eee7b70db4a587c9b8e31ee03dcb599a908250b0e14cda9e0
267
+ Service-User-Id:
268
+ - d58bd449c6bc1cc552e39f387893f65175f808785a21ded1dbe6c554294800a3
269
+ Accept-Encoding:
270
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
271
+ Accept:
272
+ - "*/*"
273
+ response:
274
+ status:
275
+ code: 201
276
+ message: 'Created '
277
+ headers:
278
+ X-Frame-Options:
279
+ - SAMEORIGIN
280
+ X-Xss-Protection:
281
+ - 1; mode=block
282
+ X-Content-Type-Options:
283
+ - nosniff
284
+ X-Ua-Compatible:
285
+ - chrome=1
286
+ Content-Type:
287
+ - application/json; charset=utf-8
288
+ Etag:
289
+ - '"db3dc094dab3f0b18b938eb7fa0eb6cc"'
290
+ Cache-Control:
291
+ - max-age=0, private, must-revalidate
292
+ X-Request-Id:
293
+ - 2f5f0c3d-76cd-4e56-b7e8-fdf5040144a9
294
+ X-Runtime:
295
+ - '0.006041'
296
+ Server:
297
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
298
+ Date:
299
+ - Thu, 08 Jan 2015 03:43:52 GMT
300
+ Content-Length:
301
+ - '256'
302
+ Connection:
303
+ - Keep-Alive
304
+ body:
305
+ encoding: UTF-8
306
+ string: |-
307
+ {
308
+ "service_user_id": "d58bd449c6bc1cc552e39f387893f65175f808785a21ded1dbe6c554294800a3",
309
+ "_links": {
310
+ "self": {
311
+ "href": "http://localhost:3000/api/user"
312
+ }
313
+ },
314
+ "token": "5d6eaa09a0131d7eee7b70db4a587c9b8e31ee03dcb599a908250b0e14cda9e0"
315
+ }
316
+ http_version:
317
+ recorded_at: Thu, 08 Jan 2015 03:43:52 GMT
318
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,702 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/users
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/json
14
+ Api-Token:
15
+ - testing
16
+ User-Token:
17
+ - cd13490902b4944acf6af4d6e8505c8e44b68e841dbfca133523f68b941587b7
18
+ Service-User-Id:
19
+ - 8104645e99aeda86d54dd596af7d3d91ed7909493bcf2e0e6291270d4303a471
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Accept:
23
+ - "*/*"
24
+ response:
25
+ status:
26
+ code: 404
27
+ message: 'Not Found '
28
+ headers:
29
+ Content-Type:
30
+ - text/html; charset=utf-8
31
+ Content-Length:
32
+ - '17312'
33
+ X-Request-Id:
34
+ - 3380d0e2-bd27-47cd-9d11-37c288ed8d7a
35
+ X-Runtime:
36
+ - '0.032888'
37
+ Server:
38
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
39
+ Date:
40
+ - Thu, 08 Jan 2015 04:02:13 GMT
41
+ Connection:
42
+ - Keep-Alive
43
+ body:
44
+ encoding: UTF-8
45
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
46
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
47
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
48
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
49
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
50
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
51
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
52
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
53
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
54
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
55
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
56
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
57
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
58
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
59
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
60
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
61
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
62
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
63
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
64
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
65
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
66
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
67
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
68
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
69
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
70
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
71
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
72
+ { color: #C52F24; }\n\n #route_table {\n margin: 0 auto 0;\n border-collapse:
73
+ collapse;\n }\n\n #route_table td {\n padding: 0 30px;\n }\n\n #route_table
74
+ tr.bottom th {\n padding-bottom: 10px;\n line-height: 15px;\n }\n\n
75
+ \ #route_table .matched_paths {\n background-color: LightGoldenRodYellow;\n
76
+ \ }\n\n #route_table .matched_paths {\n border-bottom: solid 3px SlateGrey;\n
77
+ \ }\n\n #path_search {\n width: 80%;\n font-size: inherit;\n }\n\n
78
+ \ </style>\n\n <script>\n var toggle = function(id) {\n var s = document.getElementById(id).style;\n
79
+ \ s.display = s.display == 'none' ? 'block' : 'none';\n return false;\n
80
+ \ }\n var show = function(id) {\n document.getElementById(id).style.display
81
+ = 'block';\n }\n var hide = function(id) {\n document.getElementById(id).style.display
82
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
83
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
84
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
85
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>Routing Error</h1>\n</header>\n<div
86
+ id=\"container\">\n <h2>No route matches [POST] &quot;/api/users&quot;</h2>\n\n
87
+ \ \n<p><code>Rails.root: /Users/austenito/repos/happiness/happiness_service</code></p>\n\n<div
88
+ id=\"traces\">\n <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
89
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
90
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
91
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
92
+ block;\">\n <pre><code></code></pre>\n </div>\n <div id=\"Framework-Trace\"
93
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
94
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
95
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
96
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
97
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
98
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
99
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
100
+ (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
101
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
102
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
103
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
104
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
105
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
106
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
107
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
108
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
109
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in
110
+ `block in start_thread&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\"
111
+ style=\"display: none;\">\n <pre><code>actionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in
112
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
113
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
114
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
115
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
116
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
117
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
118
+ (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
119
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
120
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
121
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
122
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
123
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
124
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
125
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
126
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
127
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in
128
+ `block in start_thread&#39;</code></pre>\n </div>\n</div>\n\n\n <h2>\n
129
+ \ Routes\n </h2>\n\n <p>\n Routes match in priority from top
130
+ to bottom\n </p>\n\n \n<table id='route_table' class='route_table'>\n
131
+ \ <thead>\n <tr>\n <th>Helper</th>\n <th>HTTP Verb</th>\n <th>Path</th>\n
132
+ \ <th>Controller#Action</th>\n </tr>\n <tr class='bottom'>\n <th>\n
133
+ \ <a data-route-helper=\"_path\" href=\"#\" title=\"Returns a relative
134
+ path (without the http or domain)\">Path</a> /\n <a data-route-helper=\"_url\"
135
+ href=\"#\" title=\"Returns an absolute url (with the http and domain)\">Url</a>\n
136
+ \ </th>\n <th>\n </th>\n <th>\n <input id=\"path_search\"
137
+ name=\"path[]\" placeholder=\"Path Match\" type=\"search\" />\n </th>\n
138
+ \ <th>\n </th>\n </tr>\n </thead>\n <tbody class='matched_paths'
139
+ id='matched_paths'>\n </tbody>\n <tbody>\n <tr class='route_row' data-helper='path'>\n
140
+ \ <td data-route-name='api_questions'>\n api_questions<span class='helper'>_path</span>\n
141
+ \ </td>\n <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/questions(.:format)'
142
+ data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n /api/questions(.:format)\n
143
+ \ </td>\n <td data-route-reqs='api/v1/questions#index {:format=&gt;&quot;json&quot;}'>\n
144
+ \ api/v1/questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
145
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
146
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/questions(.:format)'
147
+ data-regexp='^\\/api\\/questions(?:\\.([^\\/.?]+))?$'>\n /api/questions(.:format)\n
148
+ \ </td>\n <td data-route-reqs='api/v1/questions#create {:format=&gt;&quot;json&quot;}'>\n
149
+ \ api/v1/questions#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
150
+ class='route_row' data-helper='path'>\n <td data-route-name='api_question'>\n
151
+ \ api_question<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
152
+ \ GET\n </td>\n <td data-route-path='/api/questions/:id(.:format)' data-regexp='^\\/api\\/questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
153
+ \ /api/questions/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/questions#show
154
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/questions#show {:format=&gt;&quot;json&quot;}\n
155
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_questions'>\n
156
+ \ api_survey_questions<span class='helper'>_path</span>\n </td>\n <td
157
+ data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/survey_questions(.:format)'
158
+ data-regexp='^\\/api\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n /api/survey_questions(.:format)\n
159
+ \ </td>\n <td data-route-reqs='api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}'>\n
160
+ \ api/v1/survey_questions#index {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
161
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_questions'>\n
162
+ \ api_survey_survey_questions<span class='helper'>_path</span>\n </td>\n
163
+ \ <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions(.:format)'
164
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions(?:\\.([^\\/.?]+))?$'>\n
165
+ \ /api/surveys/:survey_id/survey_questions(.:format)\n </td>\n <td data-route-reqs='api/v1/survey_questions#create
166
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/survey_questions#create {:format=&gt;&quot;json&quot;}\n
167
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_survey_survey_question'>\n
168
+ \ api_survey_survey_question<span class='helper'>_path</span>\n </td>\n
169
+ \ <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
170
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
171
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
172
+ data-route-reqs='api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}'>\n
173
+ \ api/v1/survey_questions#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
174
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
175
+ \ <td data-route-verb='PATCH'>\n PATCH\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
176
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
177
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
178
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
179
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
180
+ class='route_row' data-helper='path'>\n <td data-route-name=''>\n </td>\n
181
+ \ <td data-route-verb='PUT'>\n PUT\n </td>\n <td data-route-path='/api/surveys/:survey_id/survey_questions/:id(.:format)'
182
+ data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)\\/survey_questions\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
183
+ \ /api/surveys/:survey_id/survey_questions/:id(.:format)\n </td>\n <td
184
+ data-route-reqs='api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}'>\n
185
+ \ api/v1/survey_questions#update {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
186
+ class='route_row' data-helper='path'>\n <td data-route-name='api_surveys'>\n
187
+ \ api_surveys<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
188
+ \ GET\n </td>\n <td data-route-path='/api/surveys(.:format)' data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n
189
+ \ /api/surveys(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#index
190
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#index {:format=&gt;&quot;json&quot;}\n
191
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
192
+ \ </td>\n <td data-route-verb='POST'>\n POST\n </td>\n <td data-route-path='/api/surveys(.:format)'
193
+ data-regexp='^\\/api\\/surveys(?:\\.([^\\/.?]+))?$'>\n /api/surveys(.:format)\n
194
+ \ </td>\n <td data-route-reqs='api/v1/surveys#create {:format=&gt;&quot;json&quot;}'>\n
195
+ \ api/v1/surveys#create {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
196
+ class='route_row' data-helper='path'>\n <td data-route-name='api_survey'>\n
197
+ \ api_survey<span class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n
198
+ \ GET\n </td>\n <td data-route-path='/api/surveys/:id(.:format)' data-regexp='^\\/api\\/surveys\\/([^\\/.?]+)(?:\\.([^\\/.?]+))?$'>\n
199
+ \ /api/surveys/:id(.:format)\n </td>\n <td data-route-reqs='api/v1/surveys#show
200
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/surveys#show {:format=&gt;&quot;json&quot;}\n
201
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name='api_user'>\n
202
+ \ api_user<span class='helper'>_path</span>\n </td>\n <td data-route-verb='POST'>\n
203
+ \ POST\n </td>\n <td data-route-path='/api/user(.:format)' data-regexp='^\\/api\\/user(?:\\.([^\\/.?]+))?$'>\n
204
+ \ /api/user(.:format)\n </td>\n <td data-route-reqs='api/v1/users#create
205
+ {:format=&gt;&quot;json&quot;}'>\n api/v1/users#create {:format=&gt;&quot;json&quot;}\n
206
+ \ </td>\n</tr>\n<tr class='route_row' data-helper='path'>\n <td data-route-name=''>\n
207
+ \ </td>\n <td data-route-verb='GET'>\n GET\n </td>\n <td data-route-path='/api/user(.:format)'
208
+ data-regexp='^\\/api\\/user(?:\\.([^\\/.?]+))?$'>\n /api/user(.:format)\n
209
+ \ </td>\n <td data-route-reqs='api/v1/users#show {:format=&gt;&quot;json&quot;}'>\n
210
+ \ api/v1/users#show {:format=&gt;&quot;json&quot;}\n </td>\n</tr>\n<tr
211
+ class='route_row' data-helper='path'>\n <td data-route-name='root'>\n root<span
212
+ class='helper'>_path</span>\n </td>\n <td data-route-verb='GET'>\n GET\n
213
+ \ </td>\n <td data-route-path='/' data-regexp='^\\/$'>\n /\n </td>\n
214
+ \ <td data-route-reqs='api/v1/root#index'>\n api/v1/root#index\n </td>\n</tr>\n\n
215
+ \ </tbody>\n</table>\n\n<script type='text/javascript'>\n function each(elems,
216
+ func) {\n if (!elems instanceof Array) { elems = [elems]; }\n for (var
217
+ i = 0, len = elems.length; i < len; i++) {\n func(elems[i]);\n }\n
218
+ \ }\n\n function setValOn(elems, val) {\n each(elems, function(elem) {\n
219
+ \ elem.innerHTML = val;\n });\n }\n\n function onClick(elems, func)
220
+ {\n each(elems, function(elem) {\n elem.onclick = func;\n });\n
221
+ \ }\n\n // Enables functionality to toggle between `_path` and `_url` helper
222
+ suffixes\n function setupRouteToggleHelperLinks() {\n var toggleLinks
223
+ = document.querySelectorAll('#route_table [data-route-helper]');\n onClick(toggleLinks,
224
+ function(){\n var helperTxt = this.getAttribute(\"data-route-helper\"),\n
225
+ \ helperElems = document.querySelectorAll('[data-route-name] span.helper');\n
226
+ \ setValOn(helperElems, helperTxt);\n });\n }\n\n // takes an array
227
+ of elements with a data-regexp attribute and\n // passes their their parent
228
+ <tr> into the callback function\n // if the regexp matchs a given path\n
229
+ \ function eachElemsForPath(elems, path, func) {\n each(elems, function(e){\n
230
+ \ var reg = e.getAttribute(\"data-regexp\");\n if (path.match(RegExp(reg)))
231
+ {\n func(e.parentNode.cloneNode(true));\n }\n })\n }\n\n //
232
+ Ensure path always starts with a slash \"/\" and remove params or fragments\n
233
+ \ function sanitizePath(path) {\n var path = path.charAt(0) == '/' ? path
234
+ : \"/\" + path;\n return path.replace(/\\#.*|\\?.*/, '');\n }\n\n //
235
+ Enables path search functionality\n function setupMatchPaths() {\n var
236
+ regexpElems = document.querySelectorAll('#route_table [data-regexp]'),\n
237
+ \ pathElem = document.querySelector('#path_search'),\n selectedSection
238
+ = document.querySelector('#matched_paths'),\n noMatchText = '<tr><th
239
+ colspan=\"4\">None</th></tr>';\n\n\n // Remove matches if no path is present\n
240
+ \ pathElem.onblur = function(e) {\n if (pathElem.value === \"\") selectedSection.innerHTML
241
+ = \"\";\n }\n\n // On key press perform a search for matching paths\n
242
+ \ pathElem.onkeyup = function(e){\n var path = sanitizePath(pathElem.value),\n
243
+ \ defaultText = '<tr><th colspan=\"4\">Paths Matching (' + path +
244
+ '):</th></tr>';\n\n // Clear out results section\n selectedSection.innerHTML=
245
+ defaultText;\n\n // Display matches if they exist\n eachElemsForPath(regexpElems,
246
+ path, function(e){\n selectedSection.appendChild(e);\n });\n\n
247
+ \ // If no match present, tell the user\n if (selectedSection.innerHTML
248
+ === defaultText) {\n selectedSection.innerHTML = selectedSection.innerHTML
249
+ + noMatchText;\n }\n }\n }\n\n setupMatchPaths();\n setupRouteToggleHelperLinks();\n</script>\n\n</div>\n\n\n</body>\n</html>\n"
250
+ http_version:
251
+ recorded_at: Thu, 08 Jan 2015 04:02:13 GMT
252
+ - request:
253
+ method: get
254
+ uri: http://localhost:3000/
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
+ - '"3a543c1faf13608a2dcffc78fccf95fd"'
286
+ Cache-Control:
287
+ - max-age=0, private, must-revalidate
288
+ X-Request-Id:
289
+ - c9165341-f5ec-4062-a519-1fed14ff49e0
290
+ X-Runtime:
291
+ - '0.103738'
292
+ Server:
293
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
294
+ Date:
295
+ - Sun, 25 Jan 2015 13:55:25 GMT
296
+ Content-Length:
297
+ - '1469'
298
+ Connection:
299
+ - Keep-Alive
300
+ body:
301
+ encoding: UTF-8
302
+ string: |-
303
+ {
304
+ "_links": [
305
+ {
306
+ "href": "http://localhost:3000/",
307
+ "rel": "self",
308
+ "method": "GET"
309
+ },
310
+ {
311
+ "href": "http://localhost:3000/api/surveys{/id}{?query*}",
312
+ "rel": "surveys",
313
+ "method": "GET"
314
+ },
315
+ {
316
+ "href": "http://localhost:3000/api/surveys",
317
+ "rel": "surveys",
318
+ "method": "POST"
319
+ },
320
+ {
321
+ "href": "http://localhost:3000/api/user{/id}{?query*}",
322
+ "rel": "users",
323
+ "method": "GET"
324
+ },
325
+ {
326
+ "href": "http://localhost:3000/api/user",
327
+ "rel": "users",
328
+ "method": "POST"
329
+ },
330
+ {
331
+ "href": "http://localhost:3000/api/questions{/id}{?query*}",
332
+ "rel": "questions",
333
+ "method": "GET"
334
+ },
335
+ {
336
+ "href": "http://localhost:3000/api/questions",
337
+ "rel": "questions",
338
+ "method": "POST"
339
+ },
340
+ {
341
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
342
+ "rel": "survey-questions",
343
+ "method": "GET"
344
+ },
345
+ {
346
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
347
+ "rel": "survey-questions",
348
+ "method": "POST"
349
+ },
350
+ {
351
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
352
+ "rel": "survey-questions",
353
+ "method": "PUT"
354
+ },
355
+ {
356
+ "href": "http://localhost:3000/api/questions/survey_questions{?query*}",
357
+ "rel": "survey-questions-by-query",
358
+ "method": "GET"
359
+ }
360
+ ]
361
+ }
362
+ http_version:
363
+ recorded_at: Sun, 25 Jan 2015 13:55:25 GMT
364
+ - request:
365
+ method: post
366
+ uri: http://localhost:3000/api/user
367
+ body:
368
+ encoding: UTF-8
369
+ string: "{}"
370
+ headers:
371
+ User-Agent:
372
+ - Faraday v0.9.0
373
+ Content-Type:
374
+ - application/json
375
+ Api-Token:
376
+ - testing
377
+ Accept-Encoding:
378
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
379
+ Accept:
380
+ - "*/*"
381
+ response:
382
+ status:
383
+ code: 201
384
+ message: 'Created '
385
+ headers:
386
+ X-Frame-Options:
387
+ - SAMEORIGIN
388
+ X-Xss-Protection:
389
+ - 1; mode=block
390
+ X-Content-Type-Options:
391
+ - nosniff
392
+ X-Ua-Compatible:
393
+ - chrome=1
394
+ Content-Type:
395
+ - application/json; charset=utf-8
396
+ Etag:
397
+ - '"b960ad0e627ac984185568e9954d3144"'
398
+ Cache-Control:
399
+ - max-age=0, private, must-revalidate
400
+ X-Request-Id:
401
+ - 6768dcd1-60b9-4b9a-99eb-d6740ab45f8f
402
+ X-Runtime:
403
+ - '0.022996'
404
+ Server:
405
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
406
+ Date:
407
+ - Sun, 25 Jan 2015 13:55:25 GMT
408
+ Content-Length:
409
+ - '292'
410
+ Connection:
411
+ - Keep-Alive
412
+ body:
413
+ encoding: UTF-8
414
+ string: |-
415
+ {
416
+ "service_user_id": "fc63f60d2d02dfe73d0e1aeb51088751d05c8d5f55c07530dad12fe057c825ac",
417
+ "_links": [
418
+ {
419
+ "href": "http://localhost:3000/api/user",
420
+ "rel": "self",
421
+ "method": "GET"
422
+ }
423
+ ],
424
+ "token": "413d6000436c3e27e65cb73d3f626cebdb229537d971c785a931233871e5ec03"
425
+ }
426
+ http_version:
427
+ recorded_at: Sun, 25 Jan 2015 13:55:25 GMT
428
+ - request:
429
+ method: get
430
+ uri: http://localhost:3000/
431
+ body:
432
+ encoding: US-ASCII
433
+ string: ''
434
+ headers:
435
+ User-Agent:
436
+ - Faraday v0.9.0
437
+ Content-Type:
438
+ - application/json
439
+ Api-Token:
440
+ - testing
441
+ User-Token:
442
+ - 413d6000436c3e27e65cb73d3f626cebdb229537d971c785a931233871e5ec03
443
+ Service-User-Id:
444
+ - fc63f60d2d02dfe73d0e1aeb51088751d05c8d5f55c07530dad12fe057c825ac
445
+ Accept-Encoding:
446
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
447
+ Accept:
448
+ - "*/*"
449
+ response:
450
+ status:
451
+ code: 200
452
+ message: 'OK '
453
+ headers:
454
+ X-Frame-Options:
455
+ - SAMEORIGIN
456
+ X-Xss-Protection:
457
+ - 1; mode=block
458
+ X-Content-Type-Options:
459
+ - nosniff
460
+ X-Ua-Compatible:
461
+ - chrome=1
462
+ Content-Type:
463
+ - application/json; charset=utf-8
464
+ Etag:
465
+ - '"3a543c1faf13608a2dcffc78fccf95fd"'
466
+ Cache-Control:
467
+ - max-age=0, private, must-revalidate
468
+ X-Request-Id:
469
+ - 9a9c0ad1-d4d8-4873-b39d-e7ff40a4e8d2
470
+ X-Runtime:
471
+ - '0.007417'
472
+ Server:
473
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
474
+ Date:
475
+ - Sun, 25 Jan 2015 13:55:25 GMT
476
+ Content-Length:
477
+ - '1469'
478
+ Connection:
479
+ - Keep-Alive
480
+ body:
481
+ encoding: UTF-8
482
+ string: |-
483
+ {
484
+ "_links": [
485
+ {
486
+ "href": "http://localhost:3000/",
487
+ "rel": "self",
488
+ "method": "GET"
489
+ },
490
+ {
491
+ "href": "http://localhost:3000/api/surveys{/id}{?query*}",
492
+ "rel": "surveys",
493
+ "method": "GET"
494
+ },
495
+ {
496
+ "href": "http://localhost:3000/api/surveys",
497
+ "rel": "surveys",
498
+ "method": "POST"
499
+ },
500
+ {
501
+ "href": "http://localhost:3000/api/user{/id}{?query*}",
502
+ "rel": "users",
503
+ "method": "GET"
504
+ },
505
+ {
506
+ "href": "http://localhost:3000/api/user",
507
+ "rel": "users",
508
+ "method": "POST"
509
+ },
510
+ {
511
+ "href": "http://localhost:3000/api/questions{/id}{?query*}",
512
+ "rel": "questions",
513
+ "method": "GET"
514
+ },
515
+ {
516
+ "href": "http://localhost:3000/api/questions",
517
+ "rel": "questions",
518
+ "method": "POST"
519
+ },
520
+ {
521
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
522
+ "rel": "survey-questions",
523
+ "method": "GET"
524
+ },
525
+ {
526
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
527
+ "rel": "survey-questions",
528
+ "method": "POST"
529
+ },
530
+ {
531
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
532
+ "rel": "survey-questions",
533
+ "method": "PUT"
534
+ },
535
+ {
536
+ "href": "http://localhost:3000/api/questions/survey_questions{?query*}",
537
+ "rel": "survey-questions-by-query",
538
+ "method": "GET"
539
+ }
540
+ ]
541
+ }
542
+ http_version:
543
+ recorded_at: Sun, 25 Jan 2015 13:55:25 GMT
544
+ - request:
545
+ method: post
546
+ uri: http://localhost:3000/api/surveys
547
+ body:
548
+ encoding: UTF-8
549
+ string: "{}"
550
+ headers:
551
+ User-Agent:
552
+ - Faraday v0.9.0
553
+ Content-Type:
554
+ - application/json
555
+ Api-Token:
556
+ - testing
557
+ User-Token:
558
+ - 413d6000436c3e27e65cb73d3f626cebdb229537d971c785a931233871e5ec03
559
+ Service-User-Id:
560
+ - fc63f60d2d02dfe73d0e1aeb51088751d05c8d5f55c07530dad12fe057c825ac
561
+ Accept-Encoding:
562
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
563
+ Accept:
564
+ - "*/*"
565
+ response:
566
+ status:
567
+ code: 201
568
+ message: 'Created '
569
+ headers:
570
+ X-Frame-Options:
571
+ - SAMEORIGIN
572
+ X-Xss-Protection:
573
+ - 1; mode=block
574
+ X-Content-Type-Options:
575
+ - nosniff
576
+ X-Ua-Compatible:
577
+ - chrome=1
578
+ Content-Type:
579
+ - application/json; charset=utf-8
580
+ Etag:
581
+ - '"45211cf03e3e8296d7882257bf74f38e"'
582
+ Cache-Control:
583
+ - max-age=0, private, must-revalidate
584
+ X-Request-Id:
585
+ - e56adcaa-55f9-46f9-b46c-606b9a6cb84c
586
+ X-Runtime:
587
+ - '0.042485'
588
+ Server:
589
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
590
+ Date:
591
+ - Sun, 25 Jan 2015 13:55:25 GMT
592
+ Content-Length:
593
+ - '422'
594
+ Connection:
595
+ - Keep-Alive
596
+ body:
597
+ encoding: UTF-8
598
+ string: |-
599
+ {
600
+ "id": 82,
601
+ "service_user_id": "fc63f60d2d02dfe73d0e1aeb51088751d05c8d5f55c07530dad12fe057c825ac",
602
+ "_links": [
603
+ {
604
+ "href": "http://localhost:3000/api/surveys/82",
605
+ "rel": "self",
606
+ "method": "GET"
607
+ },
608
+ {
609
+ "href": "http://localhost:3000/api/surveys/82/survey_questions",
610
+ "rel": "survey-questions",
611
+ "method": "POST"
612
+ }
613
+ ],
614
+ "completed": true,
615
+ "survey_questions": [
616
+
617
+ ]
618
+ }
619
+ http_version:
620
+ recorded_at: Sun, 25 Jan 2015 13:55:25 GMT
621
+ - request:
622
+ method: get
623
+ uri: http://localhost:3000/api/surveys
624
+ body:
625
+ encoding: US-ASCII
626
+ string: ''
627
+ headers:
628
+ User-Agent:
629
+ - Faraday v0.9.0
630
+ Content-Type:
631
+ - application/json
632
+ Api-Token:
633
+ - testing
634
+ User-Token:
635
+ - 413d6000436c3e27e65cb73d3f626cebdb229537d971c785a931233871e5ec03
636
+ Service-User-Id:
637
+ - fc63f60d2d02dfe73d0e1aeb51088751d05c8d5f55c07530dad12fe057c825ac
638
+ Accept-Encoding:
639
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
640
+ Accept:
641
+ - "*/*"
642
+ response:
643
+ status:
644
+ code: 200
645
+ message: 'OK '
646
+ headers:
647
+ X-Frame-Options:
648
+ - SAMEORIGIN
649
+ X-Xss-Protection:
650
+ - 1; mode=block
651
+ X-Content-Type-Options:
652
+ - nosniff
653
+ X-Ua-Compatible:
654
+ - chrome=1
655
+ Content-Type:
656
+ - application/json; charset=utf-8
657
+ Etag:
658
+ - '"3ebb3c1824e975843ad687cd0bd7dacc"'
659
+ Cache-Control:
660
+ - max-age=0, private, must-revalidate
661
+ X-Request-Id:
662
+ - 2f494ce6-0016-4559-877e-3b58aa5ddf12
663
+ X-Runtime:
664
+ - '0.011191'
665
+ Server:
666
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
667
+ Date:
668
+ - Sun, 25 Jan 2015 13:55:25 GMT
669
+ Content-Length:
670
+ - '521'
671
+ Connection:
672
+ - Keep-Alive
673
+ body:
674
+ encoding: UTF-8
675
+ string: |-
676
+ {
677
+ "surveys": [
678
+ {
679
+ "id": 82,
680
+ "service_user_id": "fc63f60d2d02dfe73d0e1aeb51088751d05c8d5f55c07530dad12fe057c825ac",
681
+ "_links": [
682
+ {
683
+ "href": "http://localhost:3000/api/surveys/82",
684
+ "rel": "self",
685
+ "method": "GET"
686
+ },
687
+ {
688
+ "href": "http://localhost:3000/api/surveys/82/survey_questions",
689
+ "rel": "survey-questions",
690
+ "method": "POST"
691
+ }
692
+ ],
693
+ "completed": true,
694
+ "survey_questions": [
695
+
696
+ ]
697
+ }
698
+ ]
699
+ }
700
+ http_version:
701
+ recorded_at: Sun, 25 Jan 2015 13:55:25 GMT
702
+ recorded_with: VCR 2.9.3