badgeapi 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +31 -0
  6. data/Rakefile +15 -0
  7. data/badgeapi.gemspec +33 -0
  8. data/lib/badgeapi/badge.rb +29 -0
  9. data/lib/badgeapi/badgeapi_object.rb +149 -0
  10. data/lib/badgeapi/collection.rb +10 -0
  11. data/lib/badgeapi/errors/api_error.rb +5 -0
  12. data/lib/badgeapi/errors/badgeapi_error.rb +18 -0
  13. data/lib/badgeapi/errors/invalid_request_error.rb +5 -0
  14. data/lib/badgeapi/recipient.rb +18 -0
  15. data/lib/badgeapi/version.rb +3 -0
  16. data/lib/badgeapi.rb +36 -0
  17. data/test/badge/badge_test.rb +469 -0
  18. data/test/badgeapi_test.rb +20 -0
  19. data/test/collection/collection_test.rb +275 -0
  20. data/test/fixtures/all_badges.yml +121 -0
  21. data/test/fixtures/all_badges_bad_user.yml +138 -0
  22. data/test/fixtures/all_badges_expanded.yml +196 -0
  23. data/test/fixtures/all_badges_from_collection.yml +52 -0
  24. data/test/fixtures/all_badges_issued.yml +430 -0
  25. data/test/fixtures/all_badges_limited.yml +49 -0
  26. data/test/fixtures/all_collection.yml +50 -0
  27. data/test/fixtures/all_collection_expanded.yml +131 -0
  28. data/test/fixtures/all_collection_limit.yml +49 -0
  29. data/test/fixtures/bad_Recipient.yml +183 -0
  30. data/test/fixtures/bad_Recipietn_request.yml +93 -0
  31. data/test/fixtures/bad_api_key.yml +49 -0
  32. data/test/fixtures/badge_error.yml +47 -0
  33. data/test/fixtures/badge_requirements.yml +351 -0
  34. data/test/fixtures/collection_error.yml +91 -0
  35. data/test/fixtures/create_badge.yml +97 -0
  36. data/test/fixtures/create_collection.yml +97 -0
  37. data/test/fixtures/create_new_badge_failure.yml +143 -0
  38. data/test/fixtures/create_new_collection_failure.yml +189 -0
  39. data/test/fixtures/destroy_badge.yml +277 -0
  40. data/test/fixtures/destroy_badge_error.yml +231 -0
  41. data/test/fixtures/destroy_collection.yml +185 -0
  42. data/test/fixtures/destroy_collection_error.yml +185 -0
  43. data/test/fixtures/issue_already_owned_badge.yml +49 -0
  44. data/test/fixtures/issue_badge_to_bad_user.yml +50 -0
  45. data/test/fixtures/issue_badge_to_user.yml +199 -0
  46. data/test/fixtures/issue_badge_to_user_with_library_card.yml +103 -0
  47. data/test/fixtures/one_badge.yml +49 -0
  48. data/test/fixtures/one_badge_expanded.yml +50 -0
  49. data/test/fixtures/one_collection.yml +49 -0
  50. data/test/fixtures/one_collection_expanded.yml +104 -0
  51. data/test/fixtures/recipient_with_badges.yml +187 -0
  52. data/test/fixtures/recipient_with_badges_unicard.yml +50 -0
  53. data/test/fixtures/revoke_badge_from_user.yml +199 -0
  54. data/test/fixtures/revoke_badge_not_issued.yml +49 -0
  55. data/test/fixtures/update_badge_via_update.yml +145 -0
  56. data/test/fixtures/update_badge_via_update_slug_history.yml +191 -0
  57. data/test/fixtures/update_collection.yml +191 -0
  58. data/test/fixtures/update_collection_via_update.yml +145 -0
  59. data/test/recipient/recipient_test.rb +108 -0
  60. data/test/test_helper.rb +11 -0
  61. metadata +274 -0
@@ -0,0 +1,430 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://gamification-api.dev/v1/badges?user=rob.ellis@lancaster.ac.uk
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 500
21
+ message: Internal Server Error
22
+ headers:
23
+ Content-Type:
24
+ - text/html; charset=utf-8
25
+ Content-Length:
26
+ - '22684'
27
+ X-Request-Id:
28
+ - b79c9c75-f10e-44d9-bada-e34cf603fcf9
29
+ X-Runtime:
30
+ - '0.118177'
31
+ Date:
32
+ - Thu, 16 Jul 2015 15:28:21 GMT
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
38
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
39
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
40
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
41
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
42
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
43
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
44
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
45
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
46
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
47
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
48
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
49
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
50
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
51
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
52
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
53
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
54
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
55
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
56
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
57
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
58
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
59
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
60
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
61
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
62
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
63
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
64
+ { color: #C52F24; }\n\n \n </style>\n\n <script>\n var toggle = function(id)
65
+ {\n var s = document.getElementById(id).style;\n s.display = s.display
66
+ == 'none' ? 'block' : 'none';\n return false;\n }\n var show =
67
+ function(id) {\n document.getElementById(id).style.display = 'block';\n
68
+ \ }\n var hide = function(id) {\n document.getElementById(id).style.display
69
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
70
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
71
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
72
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>\n NoMethodError\n
73
+ \ in V1::BadgesController#index\n </h1>\n</header>\n\n<div id=\"container\">\n
74
+ \ <h2>undefined method `badges&#39; for nil:NilClass</h2>\n\n <div class=\"source\">\n<div
75
+ class=\"info\">\n Extracted source (around line <strong>#28</strong>):\n</div>\n<div
76
+ class=\"data\">\n <table cellpadding=\"0\" cellspacing=\"0\" class=\"lines\">\n
77
+ \ <tr>\n <td>\n <pre class=\"line_numbers\">\n<span>26</span>\n<span>27</span>\n<span>28</span>\n<span>29</span>\n<span>30</span>\n<span>31</span>\n
78
+ \ </pre>\n </td>\n<td width=\"100%\">\n<pre>\n<div class=\"line\">\t\t\tif
79
+ @username.present?\n</div><div class=\"line\">\t\t\t\t@recipient = Recipient.find_by_username(@username[&#39;username&#39;])\n</div><div
80
+ class=\"line active\">\t\t\t\t@badges = @recipient.badges.merge(@badges)\n</div><div
81
+ class=\"line\">\t\t\tend\n</div><div class=\"line\">\n</div><div class=\"line\">\t\t\t#
82
+ Limit if required\n</div>\n</pre>\n</td>\n </tr>\n </table>\n</div>\n</div>\n\n
83
+ \ \n<p><code>Rails.root: /Users/tomskarbek/Rails/gamification_api</code></p>\n\n<div
84
+ id=\"traces\">\n <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
85
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
86
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
87
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
88
+ block;\">\n <pre><code>app/controllers/v1/badges_controller.rb:28:in
89
+ `index&#39;\napp/middleware/catch_json_parse_errors.rb:9:in `call&#39;</code></pre>\n
90
+ \ </div>\n <div id=\"Framework-Trace\" style=\"display: none;\">\n <pre><code>actionpack
91
+ (4.1.8) lib/abstract_controller/base.rb:189:in `process_action&#39;\nactionpack
92
+ (4.1.8) lib/action_controller/metal/rendering.rb:10:in `process_action&#39;\nactionpack
93
+ (4.1.8) lib/abstract_controller/callbacks.rb:20:in `block in process_action&#39;\nactivesupport
94
+ (4.1.8) lib/active_support/callbacks.rb:113:in `call&#39;\nactivesupport (4.1.8)
95
+ lib/active_support/callbacks.rb:113:in `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in
96
+ `block in halting_and_conditional&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in
97
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in `block
98
+ in halting_and_conditional&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in
99
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in `block
100
+ in halting_and_conditional&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:166:in
101
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:166:in `block
102
+ in halting&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:86:in
103
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:86:in `run_callbacks&#39;\nactionpack
104
+ (4.1.8) lib/abstract_controller/callbacks.rb:19:in `process_action&#39;\nactionpack
105
+ (4.1.8) lib/action_controller/metal/rescue.rb:29:in `process_action&#39;\nactionpack
106
+ (4.1.8) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action&#39;\nactivesupport
107
+ (4.1.8) lib/active_support/notifications.rb:159:in `block in instrument&#39;\nactivesupport
108
+ (4.1.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument&#39;\nactivesupport
109
+ (4.1.8) lib/active_support/notifications.rb:159:in `instrument&#39;\nactionpack
110
+ (4.1.8) lib/action_controller/metal/instrumentation.rb:30:in `process_action&#39;\nactiverecord
111
+ (4.1.8) lib/active_record/railties/controller_runtime.rb:18:in `process_action&#39;\nactionpack
112
+ (4.1.8) lib/abstract_controller/base.rb:136:in `process&#39;\nactionview (4.1.8)
113
+ lib/action_view/rendering.rb:30:in `process&#39;\nactionpack (4.1.8) lib/action_controller/metal.rb:196:in
114
+ `dispatch&#39;\nactionpack (4.1.8) lib/action_controller/metal/rack_delegation.rb:13:in
115
+ `dispatch&#39;\nactionpack (4.1.8) lib/action_controller/metal.rb:232:in `block
116
+ in action&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:82:in
117
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:82:in
118
+ `dispatch&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:50:in
119
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in
120
+ `block in call&#39;\nactionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in
121
+ `each&#39;\nactionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in
122
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in
123
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
124
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/rack/agent_hooks.rb:30:in
125
+ `traced_call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
126
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/rack/browser_monitoring.rb:32:in
127
+ `traced_call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
128
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/rack/developer_mode.rb:48:in
129
+ `traced_call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
130
+ `call&#39;\nrack (1.5.2) lib/rack/etag.rb:23:in `call&#39;\nnewrelic_rpm (3.12.0.288)
131
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nrack
132
+ (1.5.2) lib/rack/conditionalget.rb:25:in `call&#39;\nnewrelic_rpm (3.12.0.288)
133
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nrack
134
+ (1.5.2) lib/rack/head.rb:11:in `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
135
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/params_parser.rb:27:in
136
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
137
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
138
+ `call&#39;\nactiverecord (4.1.8) lib/active_record/query_cache.rb:36:in `call&#39;\nnewrelic_rpm
139
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
140
+ `call&#39;\nactiverecord (4.1.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in
141
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
142
+ `call&#39;\nactiverecord (4.1.8) lib/active_record/migration.rb:380:in `call&#39;\nnewrelic_rpm
143
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
144
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:29:in
145
+ `block in call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:82:in
146
+ `run_callbacks&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:27:in
147
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
148
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/reloader.rb:73:in
149
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
150
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/remote_ip.rb:76:in
151
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
152
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in
153
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
154
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in
155
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
156
+ `call&#39;\nrailties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
157
+ (4.1.8) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
158
+ (4.1.8) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
159
+ (4.1.8) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
160
+ (4.1.8) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
161
+ (4.1.8) lib/rails/rack/logger.rb:20:in `call&#39;\nnewrelic_rpm (3.12.0.288)
162
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nactionpack
163
+ (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call&#39;\nnewrelic_rpm
164
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
165
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nnewrelic_rpm
166
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
167
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in
168
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
169
+ `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nnewrelic_rpm (3.12.0.288)
170
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nactionpack
171
+ (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call&#39;\nnewrelic_rpm
172
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
173
+ `call&#39;\nrailties (4.1.8) lib/rails/engine.rb:514:in `call&#39;\nrailties
174
+ (4.1.8) lib/rails/application.rb:144:in `call&#39;\nnewrelic_rpm (3.12.0.288)
175
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\n/Users/tomskarbek/Library/Application
176
+ Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:155:in `handle&#39;\n/Users/tomskarbek/Library/Application
177
+ Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:109:in `rescue
178
+ in block (2 levels) in start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:106:in
179
+ `block (2 levels) in start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in
180
+ `each&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in
181
+ `block in start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in
182
+ `loop&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in
183
+ `start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:12:in
184
+ `run&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/bin/nack_worker:4:in
185
+ `&lt;main&gt;&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\" style=\"display:
186
+ none;\">\n <pre><code>app/controllers/v1/badges_controller.rb:28:in `index&#39;\nactionpack
187
+ (4.1.8) lib/abstract_controller/base.rb:189:in `process_action&#39;\nactionpack
188
+ (4.1.8) lib/action_controller/metal/rendering.rb:10:in `process_action&#39;\nactionpack
189
+ (4.1.8) lib/abstract_controller/callbacks.rb:20:in `block in process_action&#39;\nactivesupport
190
+ (4.1.8) lib/active_support/callbacks.rb:113:in `call&#39;\nactivesupport (4.1.8)
191
+ lib/active_support/callbacks.rb:113:in `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in
192
+ `block in halting_and_conditional&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in
193
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in `block
194
+ in halting_and_conditional&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in
195
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:149:in `block
196
+ in halting_and_conditional&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:166:in
197
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:166:in `block
198
+ in halting&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:86:in
199
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:86:in `run_callbacks&#39;\nactionpack
200
+ (4.1.8) lib/abstract_controller/callbacks.rb:19:in `process_action&#39;\nactionpack
201
+ (4.1.8) lib/action_controller/metal/rescue.rb:29:in `process_action&#39;\nactionpack
202
+ (4.1.8) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action&#39;\nactivesupport
203
+ (4.1.8) lib/active_support/notifications.rb:159:in `block in instrument&#39;\nactivesupport
204
+ (4.1.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument&#39;\nactivesupport
205
+ (4.1.8) lib/active_support/notifications.rb:159:in `instrument&#39;\nactionpack
206
+ (4.1.8) lib/action_controller/metal/instrumentation.rb:30:in `process_action&#39;\nactiverecord
207
+ (4.1.8) lib/active_record/railties/controller_runtime.rb:18:in `process_action&#39;\nactionpack
208
+ (4.1.8) lib/abstract_controller/base.rb:136:in `process&#39;\nactionview (4.1.8)
209
+ lib/action_view/rendering.rb:30:in `process&#39;\nactionpack (4.1.8) lib/action_controller/metal.rb:196:in
210
+ `dispatch&#39;\nactionpack (4.1.8) lib/action_controller/metal/rack_delegation.rb:13:in
211
+ `dispatch&#39;\nactionpack (4.1.8) lib/action_controller/metal.rb:232:in `block
212
+ in action&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:82:in
213
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:82:in
214
+ `dispatch&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:50:in
215
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in
216
+ `block in call&#39;\nactionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in
217
+ `each&#39;\nactionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in
218
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in
219
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
220
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/rack/agent_hooks.rb:30:in
221
+ `traced_call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
222
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/rack/browser_monitoring.rb:32:in
223
+ `traced_call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
224
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/rack/developer_mode.rb:48:in
225
+ `traced_call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
226
+ `call&#39;\nrack (1.5.2) lib/rack/etag.rb:23:in `call&#39;\nnewrelic_rpm (3.12.0.288)
227
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nrack
228
+ (1.5.2) lib/rack/conditionalget.rb:25:in `call&#39;\nnewrelic_rpm (3.12.0.288)
229
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nrack
230
+ (1.5.2) lib/rack/head.rb:11:in `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
231
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/params_parser.rb:27:in
232
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
233
+ `call&#39;\napp/middleware/catch_json_parse_errors.rb:9:in `call&#39;\nnewrelic_rpm
234
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
235
+ `call&#39;\nactiverecord (4.1.8) lib/active_record/query_cache.rb:36:in `call&#39;\nnewrelic_rpm
236
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
237
+ `call&#39;\nactiverecord (4.1.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in
238
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
239
+ `call&#39;\nactiverecord (4.1.8) lib/active_record/migration.rb:380:in `call&#39;\nnewrelic_rpm
240
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
241
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:29:in
242
+ `block in call&#39;\nactivesupport (4.1.8) lib/active_support/callbacks.rb:82:in
243
+ `run_callbacks&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:27:in
244
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
245
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/reloader.rb:73:in
246
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
247
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/remote_ip.rb:76:in
248
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
249
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in
250
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
251
+ `call&#39;\nactionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in
252
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
253
+ `call&#39;\nrailties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
254
+ (4.1.8) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
255
+ (4.1.8) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
256
+ (4.1.8) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
257
+ (4.1.8) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
258
+ (4.1.8) lib/rails/rack/logger.rb:20:in `call&#39;\nnewrelic_rpm (3.12.0.288)
259
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nactionpack
260
+ (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call&#39;\nnewrelic_rpm
261
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
262
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nnewrelic_rpm
263
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
264
+ `call&#39;\nactivesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in
265
+ `call&#39;\nnewrelic_rpm (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
266
+ `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nnewrelic_rpm (3.12.0.288)
267
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\nactionpack
268
+ (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call&#39;\nnewrelic_rpm
269
+ (3.12.0.288) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in
270
+ `call&#39;\nrailties (4.1.8) lib/rails/engine.rb:514:in `call&#39;\nrailties
271
+ (4.1.8) lib/rails/application.rb:144:in `call&#39;\nnewrelic_rpm (3.12.0.288)
272
+ lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call&#39;\n/Users/tomskarbek/Library/Application
273
+ Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:155:in `handle&#39;\n/Users/tomskarbek/Library/Application
274
+ Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:109:in `rescue
275
+ in block (2 levels) in start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:106:in
276
+ `block (2 levels) in start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in
277
+ `each&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in
278
+ `block in start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in
279
+ `loop&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in
280
+ `start&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:12:in
281
+ `run&#39;\n/Users/tomskarbek/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/bin/nack_worker:4:in
282
+ `&lt;main&gt;&#39;</code></pre>\n </div>\n</div>\n\n \n\n<h2 style=\"margin-top:
283
+ 30px\">Request</h2>\n<p><b>Parameters</b>:</p> <pre>{&quot;user&quot;=&gt;&quot;rob.ellis@lancaster.ac.uk&quot;}</pre>\n\n<div
284
+ class=\"details\">\n <div class=\"summary\"><a href=\"#\" onclick=\"return
285
+ toggleSessionDump()\">Toggle session dump</a></div>\n <div id=\"session_dump\"
286
+ style=\"display:none\"><pre></pre></div>\n</div>\n\n<div class=\"details\">\n
287
+ \ <div class=\"summary\"><a href=\"#\" onclick=\"return toggleEnvDump()\">Toggle
288
+ env dump</a></div>\n <div id=\"env_dump\" style=\"display:none\"><pre>HTTP_ACCEPT:
289
+ &quot;*/*&quot;\nHTTP_ACCEPT_ENCODING: &quot;gzip;q=1.0,deflate;q=0.6,identity;q=0.3&quot;\nREMOTE_ADDR:
290
+ &quot;127.0.0.1&quot;\nSERVER_NAME: &quot;gamification-api.dev&quot;</pre></div>\n</div>\n\n<h2
291
+ style=\"margin-top: 30px\">Response</h2>\n<p><b>Headers</b>:</p> <pre>None</pre>\n\n</div>\n\n\n</body>\n</html>\n"
292
+ http_version:
293
+ recorded_at: Thu, 16 Jul 2015 15:28:21 GMT
294
+ - request:
295
+ method: get
296
+ uri: http://gamification-api.dev/v1/badges?user=r.ellis@lancaster.ac.uk
297
+ body:
298
+ encoding: US-ASCII
299
+ string: ''
300
+ headers:
301
+ User-Agent:
302
+ - Faraday v0.9.1
303
+ Authorization:
304
+ - Token token="c9cde524238644fa93393159e5e9ad87"
305
+ Accept-Encoding:
306
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
307
+ Accept:
308
+ - "*/*"
309
+ response:
310
+ status:
311
+ code: 404
312
+ message: Not Found
313
+ headers:
314
+ X-Frame-Options:
315
+ - SAMEORIGIN
316
+ X-Xss-Protection:
317
+ - 1; mode=block
318
+ X-Content-Type-Options:
319
+ - nosniff
320
+ Content-Type:
321
+ - application/json; charset=utf-8
322
+ Cache-Control:
323
+ - no-cache
324
+ X-Request-Id:
325
+ - f8626019-aed8-4dc2-ac19-c4d7e4789514
326
+ X-Runtime:
327
+ - '0.084220'
328
+ Date:
329
+ - Thu, 16 Jul 2015 15:44:20 GMT
330
+ Connection:
331
+ - close
332
+ body:
333
+ encoding: UTF-8
334
+ string: '{"error":{"type":"invalid_request_error","message":"This user has no
335
+ badges","status":404}}'
336
+ http_version:
337
+ recorded_at: Thu, 16 Jul 2015 15:44:20 GMT
338
+ - request:
339
+ method: get
340
+ uri: http://gamification-api.dev/v1/badges?user=t.skarbek-wazynski@lancaster.ac.uk
341
+ body:
342
+ encoding: US-ASCII
343
+ string: ''
344
+ headers:
345
+ User-Agent:
346
+ - Faraday v0.9.1
347
+ Authorization:
348
+ - Token token="c9cde524238644fa93393159e5e9ad87"
349
+ Accept-Encoding:
350
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
351
+ Accept:
352
+ - "*/*"
353
+ response:
354
+ status:
355
+ code: 200
356
+ message: OK
357
+ headers:
358
+ X-Frame-Options:
359
+ - SAMEORIGIN
360
+ X-Xss-Protection:
361
+ - 1; mode=block
362
+ X-Content-Type-Options:
363
+ - nosniff
364
+ Content-Type:
365
+ - application/json; charset=utf-8
366
+ Etag:
367
+ - '"d285079b3dd4c8add1b94f6ed859b81e"'
368
+ Cache-Control:
369
+ - max-age=0, private, must-revalidate
370
+ X-Request-Id:
371
+ - 4c84e130-4f88-4466-8aa7-0e78bcb8e816
372
+ X-Runtime:
373
+ - '0.027804'
374
+ Date:
375
+ - Thu, 03 Sep 2015 10:55:57 GMT
376
+ Connection:
377
+ - close
378
+ body:
379
+ encoding: UTF-8
380
+ string: '[{"name":"Book Worm","description":"You have loaned out over 25 books.
381
+ Nice going!","requirements":"Loan out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-09-03T10:51:07.831Z","updated_at":"2015-09-03T10:51:07.831Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"book-worm"}]'
382
+ http_version:
383
+ recorded_at: Thu, 03 Sep 2015 10:55:57 GMT
384
+ - request:
385
+ method: get
386
+ uri: http://gamification-api.dev/v1/badges?user=0043181
387
+ body:
388
+ encoding: US-ASCII
389
+ string: ''
390
+ headers:
391
+ User-Agent:
392
+ - Faraday v0.9.1
393
+ Authorization:
394
+ - Token token="c9cde524238644fa93393159e5e9ad87"
395
+ Accept-Encoding:
396
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
397
+ Accept:
398
+ - "*/*"
399
+ response:
400
+ status:
401
+ code: 200
402
+ message: OK
403
+ headers:
404
+ X-Frame-Options:
405
+ - SAMEORIGIN
406
+ X-Xss-Protection:
407
+ - 1; mode=block
408
+ X-Content-Type-Options:
409
+ - nosniff
410
+ Content-Type:
411
+ - application/json; charset=utf-8
412
+ Etag:
413
+ - '"d285079b3dd4c8add1b94f6ed859b81e"'
414
+ Cache-Control:
415
+ - max-age=0, private, must-revalidate
416
+ X-Request-Id:
417
+ - a1950a40-c37a-480b-a875-9ebe7239517f
418
+ X-Runtime:
419
+ - '0.848036'
420
+ Date:
421
+ - Thu, 03 Sep 2015 10:55:58 GMT
422
+ Connection:
423
+ - close
424
+ body:
425
+ encoding: UTF-8
426
+ string: '[{"name":"Book Worm","description":"You have loaned out over 25 books.
427
+ Nice going!","requirements":"Loan out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-09-03T10:51:07.831Z","updated_at":"2015-09-03T10:51:07.831Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"book-worm"}]'
428
+ http_version:
429
+ recorded_at: Thu, 03 Sep 2015 10:55:58 GMT
430
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://gamification-api.dev/v1/badges?limit=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ X-Frame-Options:
24
+ - SAMEORIGIN
25
+ X-Xss-Protection:
26
+ - 1; mode=block
27
+ X-Content-Type-Options:
28
+ - nosniff
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Etag:
32
+ - '"d285079b3dd4c8add1b94f6ed859b81e"'
33
+ Cache-Control:
34
+ - max-age=0, private, must-revalidate
35
+ X-Request-Id:
36
+ - e25dba8c-4ea6-43f2-ad54-025578286b8f
37
+ X-Runtime:
38
+ - '0.015611'
39
+ Date:
40
+ - Thu, 03 Sep 2015 10:55:55 GMT
41
+ Connection:
42
+ - close
43
+ body:
44
+ encoding: UTF-8
45
+ string: '[{"name":"Book Worm","description":"You have loaned out over 25 books.
46
+ Nice going!","requirements":"Loan out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-09-03T10:51:07.831Z","updated_at":"2015-09-03T10:51:07.831Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"book-worm"}]'
47
+ http_version:
48
+ recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://gamification-api.dev/v1/collections
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ X-Frame-Options:
24
+ - SAMEORIGIN
25
+ X-Xss-Protection:
26
+ - 1; mode=block
27
+ X-Content-Type-Options:
28
+ - nosniff
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Etag:
32
+ - '"15a2f9f29e66f7ded667e8e9b8cc12e4"'
33
+ Cache-Control:
34
+ - max-age=0, private, must-revalidate
35
+ X-Request-Id:
36
+ - 63d1d140-0d7d-435f-be9d-1fb5da5615f7
37
+ X-Runtime:
38
+ - '0.015646'
39
+ Date:
40
+ - Thu, 03 Sep 2015 10:59:41 GMT
41
+ Connection:
42
+ - close
43
+ body:
44
+ encoding: UTF-8
45
+ string: '[{"id":"library","name":"Library","description":"Use your library and
46
+ earn badges","created_at":"2015-09-03T10:51:07.747Z","updated_at":"2015-09-03T10:51:07.747Z","total_points_available":125,"badge_count":4,"object":"collection"},{"id":"trim-trail","name":"Trim
47
+ Trail","description":"Get fit and health plus earn some badges","created_at":"2015-09-03T10:51:07.778Z","updated_at":"2015-09-03T10:51:07.778Z","total_points_available":100,"badge_count":2,"object":"collection"}]'
48
+ http_version:
49
+ recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
50
+ recorded_with: VCR 2.9.3