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,351 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://gamification-api.dev/v1/badges/book-worm/require
6
+ body:
7
+ encoding: UTF-8
8
+ string: required_badge%5Bid%5D=mega-worm
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Cache-Control:
34
+ - no-cache
35
+ X-Request-Id:
36
+ - 2cb2edeb-5c44-4ed8-87c5-29fd2199d576
37
+ X-Runtime:
38
+ - '0.013126'
39
+ Date:
40
+ - Tue, 21 Jul 2015 10:01:29 GMT
41
+ Connection:
42
+ - close
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"error":{"type":"invalid_request_error","message":"Unrecognized Request:
46
+ (POST /v1/badges/book-worm/require)","status":404}}'
47
+ http_version:
48
+ recorded_at: Tue, 21 Jul 2015 10:01:29 GMT
49
+ - request:
50
+ method: get
51
+ uri: http://gamification-api.dev/v1/badges/1
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ''
55
+ headers:
56
+ User-Agent:
57
+ - Faraday v0.9.1
58
+ Authorization:
59
+ - Token token="c9cde524238644fa93393159e5e9ad87"
60
+ Accept-Encoding:
61
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
62
+ Accept:
63
+ - "*/*"
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ X-Frame-Options:
70
+ - SAMEORIGIN
71
+ X-Xss-Protection:
72
+ - 1; mode=block
73
+ X-Content-Type-Options:
74
+ - nosniff
75
+ Content-Type:
76
+ - application/json; charset=utf-8
77
+ Etag:
78
+ - '"7375a72c89785842b9c3663fea03002d"'
79
+ Cache-Control:
80
+ - max-age=0, private, must-revalidate
81
+ X-Request-Id:
82
+ - de89031b-bbc8-4325-8d6f-61497fe48b5a
83
+ X-Runtime:
84
+ - '0.015381'
85
+ Date:
86
+ - Tue, 21 Jul 2015 10:01:54 GMT
87
+ Connection:
88
+ - close
89
+ body:
90
+ encoding: UTF-8
91
+ string: '{"name":"Book Worm","description":"You have loaned out over 25 books.
92
+ Nice going!","requirements":"Loan out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/uploads/badge/image/1/seed.png","collection_id":"library","created_at":"2015-07-16T09:21:22.448Z","updated_at":"2015-07-16T09:21:22.448Z","level":"bronze","image_greyscale":"http://gamification-api.dev/uploads/badge/image/1/grey_seed.png","required_badges":[],"points":25,"id":"book-worm"}'
93
+ http_version:
94
+ recorded_at: Tue, 21 Jul 2015 10:01:54 GMT
95
+ - request:
96
+ method: post
97
+ uri: http://gamification-api.dev/v1/badges/book-worm/requires
98
+ body:
99
+ encoding: UTF-8
100
+ string: required_badge%5Bid%5D=mega-book-worm
101
+ headers:
102
+ User-Agent:
103
+ - Faraday v0.9.1
104
+ Authorization:
105
+ - Token token="c9cde524238644fa93393159e5e9ad87"
106
+ Content-Type:
107
+ - application/x-www-form-urlencoded
108
+ Accept-Encoding:
109
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
110
+ Accept:
111
+ - "*/*"
112
+ response:
113
+ status:
114
+ code: 422
115
+ message: Unprocessable Entity
116
+ headers:
117
+ X-Frame-Options:
118
+ - SAMEORIGIN
119
+ X-Xss-Protection:
120
+ - 1; mode=block
121
+ X-Content-Type-Options:
122
+ - nosniff
123
+ Content-Type:
124
+ - application/json; charset=utf-8
125
+ Cache-Control:
126
+ - no-cache
127
+ X-Request-Id:
128
+ - 4372fd68-cf6b-4ec4-9ed3-9ed820549b63
129
+ X-Runtime:
130
+ - '0.022954'
131
+ Date:
132
+ - Tue, 21 Jul 2015 10:46:45 GMT
133
+ Connection:
134
+ - close
135
+ body:
136
+ encoding: UTF-8
137
+ string: '{"error":{"type":"invalid_request_error","message":"The badge Book
138
+ Worm cannot require Mega Book Worm as Mega Book Worm already requires Book
139
+ Worm. Required badges can only be one-directional","status":422}}'
140
+ http_version:
141
+ recorded_at: Tue, 21 Jul 2015 10:46:45 GMT
142
+ - request:
143
+ method: get
144
+ uri: http://gamification-api.dev/v1/badges/book-worm
145
+ body:
146
+ encoding: US-ASCII
147
+ string: ''
148
+ headers:
149
+ User-Agent:
150
+ - Faraday v0.9.1
151
+ Authorization:
152
+ - Token token="c9cde524238644fa93393159e5e9ad87"
153
+ Accept-Encoding:
154
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
155
+ Accept:
156
+ - "*/*"
157
+ response:
158
+ status:
159
+ code: 200
160
+ message: OK
161
+ headers:
162
+ X-Frame-Options:
163
+ - SAMEORIGIN
164
+ X-Xss-Protection:
165
+ - 1; mode=block
166
+ X-Content-Type-Options:
167
+ - nosniff
168
+ Content-Type:
169
+ - application/json; charset=utf-8
170
+ Etag:
171
+ - '"351520548f54943b5795ee367e48a4ea"'
172
+ Cache-Control:
173
+ - max-age=0, private, must-revalidate
174
+ X-Request-Id:
175
+ - 2bf5a36f-e04d-4a01-ae9b-692f6fb51688
176
+ X-Runtime:
177
+ - '0.018645'
178
+ Date:
179
+ - Fri, 24 Jul 2015 15:34:24 GMT
180
+ Connection:
181
+ - close
182
+ body:
183
+ encoding: ASCII-8BIT
184
+ string: !binary |-
185
+ eyJuYW1lIjoiQm9vayBXb3JtIiwiZGVzY3JpcHRpb24iOiJZb3UgaGF2ZSBs
186
+ b2FuZWQgb3V0IG92ZXIgMjUgYm9va3MuIE5pY2UgZ29pbmchIiwicmVxdWly
187
+ ZW1lbnRzIjoiTG9hbiBvdXQgMjUgYm9va3MiLCJoaW50IjoiWW91IG11c3Qg
188
+ bGlrZSBib29rcy4uLiIsImltYWdlIjoiaHR0cDovL2dhbWlmaWNhdGlvbi1h
189
+ cGkuZGV2L2JhZGdlX2ltYWdlcy9ib29rLXdvcm0vYmFkZ2UucG5nIiwiY29s
190
+ bGVjdGlvbl9pZCI6ImxpYnJhcnkiLCJjcmVhdGVkX2F0IjoiMjAxNS0wNy0x
191
+ NlQwOToyMToyMi40NDhaIiwidXBkYXRlZF9hdCI6IjIwMTUtMDctMjRUMTU6
192
+ MjY6NDAuMDg2WiIsImxldmVsIjoiYnJvbnplIiwicmVxdWlyZWRfYmFkZ2Vz
193
+ IjpbeyJuYW1lIjoiT3VyIEJlc3QgRnJpZW5kIiwiZGVzY3JpcHRpb24iOiJZ
194
+ b3UgZGlkbid0IGdldCBhbnkgZmluZXMgaW4gdGhlIGxhc3QgMTIgbW9udGhz
195
+ ISIsInJlcXVpcmVtZW50cyI6IsKjMCBpbiBmaW5lcyBmb3IgdGhlIHBhc3Qg
196
+ MTIgbW9udGhzIiwiaGludCI6IkRvbid0IGdldCBpbiB0cm91YmxlIG5vdy4u
197
+ LiIsImltYWdlIjoiaHR0cDovL2dhbWlmaWNhdGlvbi1hcGkuZGV2L2JhZGdl
198
+ X2ltYWdlcy9vdXItYmVzdC1mcmllbmQvYmFkZ2UucG5nIiwiY29sbGVjdGlv
199
+ bl9pZCI6ImxpYnJhcnkiLCJjcmVhdGVkX2F0IjoiMjAxNS0wNy0xNlQwOToy
200
+ MToyMi42ODBaIiwidXBkYXRlZF9hdCI6IjIwMTUtMDctMTZUMDk6MjE6MjIu
201
+ NjgwWiIsImxldmVsIjoiYnJvbnplIiwicmVxdWlyZWRfYmFkZ2VzIjpbXSwi
202
+ cG9pbnRzIjoyNSwiaWQiOiJvdXItYmVzdC1mcmllbmQifV0sInBvaW50cyI6
203
+ MjUsImlkIjoiYm9vay13b3JtIn0=
204
+ http_version:
205
+ recorded_at: Fri, 24 Jul 2015 15:34:24 GMT
206
+ - request:
207
+ method: get
208
+ uri: http://gamification-api.dev/v1/badges/marathon-man
209
+ body:
210
+ encoding: US-ASCII
211
+ string: ''
212
+ headers:
213
+ User-Agent:
214
+ - Faraday v0.9.1
215
+ Authorization:
216
+ - Token token="c9cde524238644fa93393159e5e9ad87"
217
+ Accept-Encoding:
218
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
219
+ Accept:
220
+ - "*/*"
221
+ response:
222
+ status:
223
+ code: 200
224
+ message: OK
225
+ headers:
226
+ X-Frame-Options:
227
+ - SAMEORIGIN
228
+ X-Xss-Protection:
229
+ - 1; mode=block
230
+ X-Content-Type-Options:
231
+ - nosniff
232
+ Content-Type:
233
+ - application/json; charset=utf-8
234
+ Etag:
235
+ - '"b76260b4f37f78960fc02bad26465d56"'
236
+ Cache-Control:
237
+ - max-age=0, private, must-revalidate
238
+ X-Request-Id:
239
+ - 311b67f1-f184-4dd2-a3a4-69a01f12d703
240
+ X-Runtime:
241
+ - '0.031512'
242
+ Date:
243
+ - Thu, 03 Sep 2015 10:55:55 GMT
244
+ Connection:
245
+ - close
246
+ body:
247
+ encoding: UTF-8
248
+ string: '{"name":"Marathon Man","description":"You have run 10 laps of the trips
249
+ trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
250
+ trail over any time","hint":"Keep going...","image":"http://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.150Z","updated_at":"2015-09-03T10:51:08.150Z","level":"gold","auto_issue":false,"status":"live","required_badges":[],"points":75,"object":"badge","id":"marathon-man"}'
251
+ http_version:
252
+ recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
253
+ - request:
254
+ method: post
255
+ uri: http://gamification-api.dev/v1/badges/marathon-man/requires
256
+ body:
257
+ encoding: UTF-8
258
+ string: required_badge%5Bid%5D=you-trim-trailed
259
+ headers:
260
+ User-Agent:
261
+ - Faraday v0.9.1
262
+ Authorization:
263
+ - Token token="c9cde524238644fa93393159e5e9ad87"
264
+ Content-Type:
265
+ - application/x-www-form-urlencoded
266
+ Accept-Encoding:
267
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
268
+ Accept:
269
+ - "*/*"
270
+ response:
271
+ status:
272
+ code: 200
273
+ message: OK
274
+ headers:
275
+ X-Frame-Options:
276
+ - SAMEORIGIN
277
+ X-Xss-Protection:
278
+ - 1; mode=block
279
+ X-Content-Type-Options:
280
+ - nosniff
281
+ Content-Type:
282
+ - application/json; charset=utf-8
283
+ Etag:
284
+ - '"5da6c4e1a6de18690aed1bd0d1847a38"'
285
+ Cache-Control:
286
+ - max-age=0, private, must-revalidate
287
+ X-Request-Id:
288
+ - 1d5d268f-ad6e-4ea7-ad91-48090a23782a
289
+ X-Runtime:
290
+ - '0.025049'
291
+ Date:
292
+ - Thu, 03 Sep 2015 10:55:55 GMT
293
+ Connection:
294
+ - close
295
+ body:
296
+ encoding: UTF-8
297
+ string: '{"name":"Marathon Man","description":"You have run 10 laps of the trips
298
+ trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
299
+ trail over any time","hint":"Keep going...","image":"http://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.150Z","updated_at":"2015-09-03T10:51:08.150Z","level":"gold","auto_issue":false,"status":"live","required_badges":[{"name":"You
300
+ Trim Trailed!","description":"You ran one lap of the trim trail","requirements":"Complete
301
+ one lap of the trim trail","hint":"Have to used the trim trail?","image":"http://gamification-api.dev/badge_images/you-trim-trailed/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.077Z","updated_at":"2015-09-03T10:51:08.077Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"you-trim-trailed"}],"points":75,"object":"badge","id":"marathon-man"}'
302
+ http_version:
303
+ recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
304
+ - request:
305
+ method: delete
306
+ uri: http://gamification-api.dev/v1/badges/marathon-man/requires?required_badge%5Bid%5D=you-trim-trailed
307
+ body:
308
+ encoding: US-ASCII
309
+ string: ''
310
+ headers:
311
+ User-Agent:
312
+ - Faraday v0.9.1
313
+ Authorization:
314
+ - Token token="c9cde524238644fa93393159e5e9ad87"
315
+ Accept-Encoding:
316
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
317
+ Accept:
318
+ - "*/*"
319
+ response:
320
+ status:
321
+ code: 200
322
+ message: OK
323
+ headers:
324
+ X-Frame-Options:
325
+ - SAMEORIGIN
326
+ X-Xss-Protection:
327
+ - 1; mode=block
328
+ X-Content-Type-Options:
329
+ - nosniff
330
+ Content-Type:
331
+ - application/json; charset=utf-8
332
+ Etag:
333
+ - '"b76260b4f37f78960fc02bad26465d56"'
334
+ Cache-Control:
335
+ - max-age=0, private, must-revalidate
336
+ X-Request-Id:
337
+ - 61d8e380-87c6-496f-8753-97ef7496de76
338
+ X-Runtime:
339
+ - '0.020232'
340
+ Date:
341
+ - Thu, 03 Sep 2015 10:55:56 GMT
342
+ Connection:
343
+ - close
344
+ body:
345
+ encoding: UTF-8
346
+ string: '{"name":"Marathon Man","description":"You have run 10 laps of the trips
347
+ trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
348
+ trail over any time","hint":"Keep going...","image":"http://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.150Z","updated_at":"2015-09-03T10:51:08.150Z","level":"gold","auto_issue":false,"status":"live","required_badges":[],"points":75,"object":"badge","id":"marathon-man"}'
349
+ http_version:
350
+ recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
351
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://gamification-api.dev/v1/collections/27
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: 404
21
+ message: Not Found
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
+ Cache-Control:
32
+ - no-cache
33
+ X-Request-Id:
34
+ - 8bcde502-492f-45b1-b6bf-c0768ee6296d
35
+ X-Runtime:
36
+ - '0.013307'
37
+ Date:
38
+ - Thu, 03 Sep 2015 10:59:41 GMT
39
+ Connection:
40
+ - close
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"error":{"type":"invalid_request_error","message":"No collection exists
44
+ with id: 27","status":404}}'
45
+ http_version:
46
+ recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://gamification-api.dev/v1/collections/27
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ User-Agent:
55
+ - Faraday v0.9.1
56
+ Authorization:
57
+ - Token token="c9cde524238644fa93393159e5e9ad87"
58
+ Accept-Encoding:
59
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
60
+ Accept:
61
+ - "*/*"
62
+ response:
63
+ status:
64
+ code: 404
65
+ message: Not Found
66
+ headers:
67
+ X-Frame-Options:
68
+ - SAMEORIGIN
69
+ X-Xss-Protection:
70
+ - 1; mode=block
71
+ X-Content-Type-Options:
72
+ - nosniff
73
+ Content-Type:
74
+ - application/json; charset=utf-8
75
+ Cache-Control:
76
+ - no-cache
77
+ X-Request-Id:
78
+ - f190d9e2-8f89-4f06-a99b-34d4a4e3b5fb
79
+ X-Runtime:
80
+ - '0.011679'
81
+ Date:
82
+ - Thu, 03 Sep 2015 10:59:41 GMT
83
+ Connection:
84
+ - close
85
+ body:
86
+ encoding: UTF-8
87
+ string: '{"error":{"type":"invalid_request_error","message":"No collection exists
88
+ with id: 27","status":404}}'
89
+ http_version:
90
+ recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
91
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,97 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://gamification-api.dev/v1/badges
6
+ body:
7
+ encoding: UTF-8
8
+ string: badge%5Bauto_issue%5D=true&badge%5Bcollection_id%5D=1&badge%5Bdescription%5D=This+is+a+new+badge&badge%5Bhint%5D=Love+us..&badge%5Blevel%5D=silver&badge%5Bname%5D=Create+Badge+Test&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Etag:
34
+ - '"a77f2514d4666598c45a619d9b6dd8ab"'
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - 5fa77d10-8b12-469f-a165-be1285ae5b8b
39
+ X-Runtime:
40
+ - '0.077204'
41
+ Date:
42
+ - Thu, 03 Sep 2015 10:55:56 GMT
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"name":"Create Badge Test","description":"This is a new badge","requirements":"You
48
+ need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-test/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:56.132Z","updated_at":"2015-09-03T10:55:56.132Z","level":"silver","auto_issue":true,"status":"draft","required_badges":[],"points":50,"object":"badge","id":"create-badge-test"}'
49
+ http_version:
50
+ recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
51
+ - request:
52
+ method: delete
53
+ uri: http://gamification-api.dev/v1/badges/create-badge-test
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - Faraday v0.9.1
60
+ Authorization:
61
+ - Token token="c9cde524238644fa93393159e5e9ad87"
62
+ Accept-Encoding:
63
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
64
+ Accept:
65
+ - "*/*"
66
+ response:
67
+ status:
68
+ code: 200
69
+ message: OK
70
+ headers:
71
+ X-Frame-Options:
72
+ - SAMEORIGIN
73
+ X-Xss-Protection:
74
+ - 1; mode=block
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ Content-Type:
78
+ - application/json; charset=utf-8
79
+ Etag:
80
+ - '"a77f2514d4666598c45a619d9b6dd8ab"'
81
+ Cache-Control:
82
+ - max-age=0, private, must-revalidate
83
+ X-Request-Id:
84
+ - 6e5cbd8d-4119-4b8f-bdb9-0854797176cd
85
+ X-Runtime:
86
+ - '0.026501'
87
+ Date:
88
+ - Thu, 03 Sep 2015 10:55:56 GMT
89
+ Connection:
90
+ - close
91
+ body:
92
+ encoding: UTF-8
93
+ string: '{"name":"Create Badge Test","description":"This is a new badge","requirements":"You
94
+ need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-test/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:56.132Z","updated_at":"2015-09-03T10:55:56.132Z","level":"silver","auto_issue":true,"status":"draft","required_badges":[],"points":50,"object":"badge","id":"create-badge-test"}'
95
+ http_version:
96
+ recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
97
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,97 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://gamification-api.dev/v1/collections
6
+ body:
7
+ encoding: UTF-8
8
+ string: collection%5Bdescription%5D=This+is+a+new+collection&collection%5Bname%5D=Create+Collection+Test
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Etag:
34
+ - '"7f75ddf0d4b061fac6d57841515fa03b"'
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - 711ffd60-712b-4dc6-a46b-f6b65466fa25
39
+ X-Runtime:
40
+ - '0.025871'
41
+ Date:
42
+ - Thu, 03 Sep 2015 10:59:41 GMT
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"id":"create-collection-test","name":"Create Collection Test","description":"This
48
+ is a new collection","created_at":"2015-09-03T10:59:41.200Z","updated_at":"2015-09-03T10:59:41.200Z","total_points_available":0,"badge_count":0,"object":"collection"}'
49
+ http_version:
50
+ recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
51
+ - request:
52
+ method: delete
53
+ uri: http://gamification-api.dev/v1/collections/create-collection-test
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - Faraday v0.9.1
60
+ Authorization:
61
+ - Token token="c9cde524238644fa93393159e5e9ad87"
62
+ Accept-Encoding:
63
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
64
+ Accept:
65
+ - "*/*"
66
+ response:
67
+ status:
68
+ code: 200
69
+ message: OK
70
+ headers:
71
+ X-Frame-Options:
72
+ - SAMEORIGIN
73
+ X-Xss-Protection:
74
+ - 1; mode=block
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ Content-Type:
78
+ - application/json; charset=utf-8
79
+ Etag:
80
+ - '"7f75ddf0d4b061fac6d57841515fa03b"'
81
+ Cache-Control:
82
+ - max-age=0, private, must-revalidate
83
+ X-Request-Id:
84
+ - 9dc5194c-1ee6-4347-b44d-622318b06b4c
85
+ X-Runtime:
86
+ - '0.019878'
87
+ Date:
88
+ - Thu, 03 Sep 2015 10:59:41 GMT
89
+ Connection:
90
+ - close
91
+ body:
92
+ encoding: UTF-8
93
+ string: '{"id":"create-collection-test","name":"Create Collection Test","description":"This
94
+ is a new collection","created_at":"2015-09-03T10:59:41.200Z","updated_at":"2015-09-03T10:59:41.200Z","total_points_available":0,"badge_count":0,"object":"collection"}'
95
+ http_version:
96
+ recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
97
+ recorded_with: VCR 2.9.3