badgeapi 0.3.10 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rubocop.yml +147 -0
  4. data/README.md +44 -12
  5. data/Rakefile +24 -11
  6. data/badgeapi.gemspec +23 -22
  7. data/lib/badgeapi/badge.rb +24 -27
  8. data/lib/badgeapi/badgeapi_object.rb +160 -147
  9. data/lib/badgeapi/collection.rb +6 -9
  10. data/lib/badgeapi/errors/api_error.rb +3 -4
  11. data/lib/badgeapi/errors/badgeapi_error.rb +15 -15
  12. data/lib/badgeapi/errors/invalid_request_error.rb +3 -4
  13. data/lib/badgeapi/recipient.rb +13 -16
  14. data/lib/badgeapi/version.rb +1 -1
  15. data/lib/badgeapi.rb +13 -15
  16. data/test/badge/badge_test.rb +71 -150
  17. data/test/badgeapi_test.rb +4 -0
  18. data/test/collection/collection_test.rb +43 -77
  19. data/test/fixtures/badge_all.yml +113 -0
  20. data/test/fixtures/{bad_api_key.yml → badge_all_bad_user.yml} +14 -13
  21. data/test/fixtures/{all_badges_bad_user.yml → badge_all_badges_bad_user.yml} +16 -57
  22. data/test/fixtures/badge_all_expanded.yml +184 -0
  23. data/test/fixtures/badge_all_from_collection.yml +52 -0
  24. data/test/fixtures/badge_all_issued.yml +99 -0
  25. data/test/fixtures/{all_badges_limited.yml → badge_all_limited.yml} +10 -8
  26. data/test/fixtures/{create_badge.yml → badge_create.yml} +20 -16
  27. data/test/fixtures/{create_new_badge_failure.yml → badge_create_new.yml} +28 -22
  28. data/test/fixtures/badge_destroy.yml +147 -0
  29. data/test/fixtures/badge_destroy_error.yml +147 -0
  30. data/test/fixtures/badge_error.yml +54 -6
  31. data/test/fixtures/{issue_badge_to_bad_user.yml → badge_issue_to_bad_user.yml} +8 -6
  32. data/test/fixtures/badge_issue_to_user.yml +107 -0
  33. data/test/fixtures/{issue_badge_to_user_with_library_card.yml → badge_issue_to_user_with_library_card.yml} +21 -17
  34. data/test/fixtures/{one_badge.yml → badge_one.yml} +10 -8
  35. data/test/fixtures/{one_badge_expanded.yml → badge_one_expanded.yml} +11 -9
  36. data/test/fixtures/badge_requirements.yml +150 -105
  37. data/test/fixtures/badge_revoke_from_user.yml +107 -0
  38. data/test/fixtures/{update_badge_via_update.yml → badge_update_via_update.yml} +31 -25
  39. data/test/fixtures/{update_badge_via_update_slug_history.yml → badge_update_via_update_slug_history.yml} +41 -33
  40. data/test/fixtures/{all_collection.yml → collection_all.yml} +11 -9
  41. data/test/fixtures/collection_all_expanded.yml +123 -0
  42. data/test/fixtures/{all_collection_limit.yml → collection_all_limit.yml} +10 -8
  43. data/test/fixtures/{create_collection.yml → collection_create.yml} +20 -16
  44. data/test/fixtures/{create_new_collection_failure.yml → collection_create_new_failure.yml} +36 -28
  45. data/test/fixtures/{destroy_collection.yml → collection_destroy.yml} +36 -28
  46. data/test/fixtures/{destroy_collection_error.yml → collection_destroy_error.yml} +36 -28
  47. data/test/fixtures/collection_error.yml +108 -12
  48. data/test/fixtures/{one_collection.yml → collection_one.yml} +10 -8
  49. data/test/fixtures/collection_one_expanded.yml +106 -0
  50. data/test/fixtures/{update_collection.yml → collection_update.yml} +40 -32
  51. data/test/fixtures/{update_collection_via_update.yml → collection_update_via_update.yml} +30 -24
  52. data/test/fixtures/{bad_Recipietn_request.yml → recipient_bad_user_data.yml} +26 -22
  53. data/test/fixtures/recipient_with_badges.yml +20 -108
  54. data/test/fixtures/recipient_with_badges_unicard.yml +151 -8
  55. data/test/recipient/recipient_test.rb +11 -29
  56. metadata +69 -73
  57. data/test/fixtures/all_badges.yml +0 -121
  58. data/test/fixtures/all_badges_expanded.yml +0 -196
  59. data/test/fixtures/all_badges_from_collection.yml +0 -52
  60. data/test/fixtures/all_badges_issued.yml +0 -430
  61. data/test/fixtures/all_collection_expanded.yml +0 -131
  62. data/test/fixtures/bad_Recipient.yml +0 -183
  63. data/test/fixtures/destroy_badge.yml +0 -277
  64. data/test/fixtures/destroy_badge_error.yml +0 -231
  65. data/test/fixtures/issue_already_owned_badge.yml +0 -49
  66. data/test/fixtures/issue_badge_to_user.yml +0 -199
  67. data/test/fixtures/one_collection_expanded.yml +0 -104
  68. data/test/fixtures/revoke_badge_from_user.yml +0 -199
  69. data/test/fixtures/revoke_badge_not_issued.yml +0 -49
@@ -1,183 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://gamification-api.dev/v1/recipients?user=dfsgsdgg
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
- - f5eadd51-1671-4c29-add5-0509508fd460
35
- X-Runtime:
36
- - '0.023088'
37
- Date:
38
- - Thu, 03 Sep 2015 10:56:09 GMT
39
- Connection:
40
- - close
41
- body:
42
- encoding: UTF-8
43
- string: '{"error":{"type":"invalid_request_error","message":"Unable to find
44
- user with specified data dfsgsdgg. Recipient data must be a university email
45
- address, university card number or username.","status":404}}'
46
- http_version:
47
- recorded_at: Thu, 03 Sep 2015 10:56:09 GMT
48
- - request:
49
- method: get
50
- uri: http://gamification-api.dev/v1/recipients?user=dfsgsdgg
51
- body:
52
- encoding: US-ASCII
53
- string: ''
54
- headers:
55
- User-Agent:
56
- - Faraday v0.9.1
57
- Authorization:
58
- - Token token="c9cde524238644fa93393159e5e9ad87"
59
- Accept-Encoding:
60
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
61
- Accept:
62
- - "*/*"
63
- response:
64
- status:
65
- code: 404
66
- message: Not Found
67
- headers:
68
- X-Frame-Options:
69
- - SAMEORIGIN
70
- X-Xss-Protection:
71
- - 1; mode=block
72
- X-Content-Type-Options:
73
- - nosniff
74
- Content-Type:
75
- - application/json; charset=utf-8
76
- Cache-Control:
77
- - no-cache
78
- X-Request-Id:
79
- - 76d57c2a-2efa-4a2f-80fd-bd9a98808b37
80
- X-Runtime:
81
- - '0.015357'
82
- Date:
83
- - Thu, 03 Sep 2015 10:56:09 GMT
84
- Connection:
85
- - close
86
- body:
87
- encoding: UTF-8
88
- string: '{"error":{"type":"invalid_request_error","message":"Unable to find
89
- user with specified data dfsgsdgg. Recipient data must be a university email
90
- address, university card number or username.","status":404}}'
91
- http_version:
92
- recorded_at: Thu, 03 Sep 2015 10:56:09 GMT
93
- - request:
94
- method: get
95
- uri: http://gamification-api.dev/v1/recipients?user=j.stennet@lancaster.ac.uk
96
- body:
97
- encoding: US-ASCII
98
- string: ''
99
- headers:
100
- User-Agent:
101
- - Faraday v0.9.1
102
- Authorization:
103
- - Token token="c9cde524238644fa93393159e5e9ad87"
104
- Accept-Encoding:
105
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
106
- Accept:
107
- - "*/*"
108
- response:
109
- status:
110
- code: 404
111
- message: Not Found
112
- headers:
113
- X-Frame-Options:
114
- - SAMEORIGIN
115
- X-Xss-Protection:
116
- - 1; mode=block
117
- X-Content-Type-Options:
118
- - nosniff
119
- Content-Type:
120
- - application/json; charset=utf-8
121
- Cache-Control:
122
- - no-cache
123
- X-Request-Id:
124
- - 4a861db8-1465-4398-8dae-b6383618f6f5
125
- X-Runtime:
126
- - '0.017613'
127
- Date:
128
- - Thu, 03 Sep 2015 10:56:09 GMT
129
- Connection:
130
- - close
131
- body:
132
- encoding: UTF-8
133
- string: '{"error":{"type":"invalid_request_error","message":"Unable to find
134
- user with specified data j.stennet@lancaster.ac.uk. Recipient data must be
135
- a university email address, university card number or username.","status":404}}'
136
- http_version:
137
- recorded_at: Thu, 03 Sep 2015 10:56:09 GMT
138
- - request:
139
- method: get
140
- uri: http://gamification-api.dev/v1/recipients?user=j.stennet@lancaster.ac.uk
141
- body:
142
- encoding: US-ASCII
143
- string: ''
144
- headers:
145
- User-Agent:
146
- - Faraday v0.9.1
147
- Authorization:
148
- - Token token="c9cde524238644fa93393159e5e9ad87"
149
- Accept-Encoding:
150
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
151
- Accept:
152
- - "*/*"
153
- response:
154
- status:
155
- code: 404
156
- message: Not Found
157
- headers:
158
- X-Frame-Options:
159
- - SAMEORIGIN
160
- X-Xss-Protection:
161
- - 1; mode=block
162
- X-Content-Type-Options:
163
- - nosniff
164
- Content-Type:
165
- - application/json; charset=utf-8
166
- Cache-Control:
167
- - no-cache
168
- X-Request-Id:
169
- - 13e3d08b-605a-4bae-8250-4f5397724585
170
- X-Runtime:
171
- - '0.015878'
172
- Date:
173
- - Thu, 03 Sep 2015 10:56:09 GMT
174
- Connection:
175
- - close
176
- body:
177
- encoding: UTF-8
178
- string: '{"error":{"type":"invalid_request_error","message":"Unable to find
179
- user with specified data j.stennet@lancaster.ac.uk. Recipient data must be
180
- a university email address, university card number or username.","status":404}}'
181
- http_version:
182
- recorded_at: Thu, 03 Sep 2015 10:56:09 GMT
183
- recorded_with: VCR 2.9.3
@@ -1,277 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
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
- - '"5c6438cacbae5b4e79dcbf9cb245feca"'
33
- Cache-Control:
34
- - max-age=0, private, must-revalidate
35
- X-Request-Id:
36
- - 2cb7df27-5d8e-4d7a-9e37-4d2ac2c8cad1
37
- X-Runtime:
38
- - '0.028375'
39
- Date:
40
- - Wed, 26 Aug 2015 13:33:30 GMT
41
- Connection:
42
- - close
43
- body:
44
- encoding: UTF-8
45
- string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
46
- need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-08-26T13:33:29.985Z","updated_at":"2015-08-26T13:33:30.103Z","level":"bronze","auto_issue":false,"status":"deleted","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
47
- http_version:
48
- recorded_at: Wed, 26 Aug 2015 13:33:30 GMT
49
- - request:
50
- method: delete
51
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy-test
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
- - '"1fcd9ea83424440c49e580463e934382"'
79
- Cache-Control:
80
- - max-age=0, private, must-revalidate
81
- X-Request-Id:
82
- - 7f0b0e06-585f-4656-b53e-0ec9d8e7dd2c
83
- X-Runtime:
84
- - '0.034984'
85
- Date:
86
- - Thu, 27 Aug 2015 08:26:21 GMT
87
- Connection:
88
- - close
89
- body:
90
- encoding: UTF-8
91
- string: '{"name":"Create Badge for Destroy Test","description":"This is a new
92
- badge","requirements":"You need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy-test/badge.png","collection_id":"library","created_at":"2015-08-27T08:26:21.600Z","updated_at":"2015-08-27T08:26:21.600Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy-test"}'
93
- http_version:
94
- recorded_at: Thu, 27 Aug 2015 08:26:21 GMT
95
- - request:
96
- method: get
97
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy-test
98
- body:
99
- encoding: US-ASCII
100
- string: ''
101
- headers:
102
- User-Agent:
103
- - Faraday v0.9.1
104
- Authorization:
105
- - Token token="c9cde524238644fa93393159e5e9ad87"
106
- Accept-Encoding:
107
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
108
- Accept:
109
- - "*/*"
110
- response:
111
- status:
112
- code: 404
113
- message: Not Found
114
- headers:
115
- X-Frame-Options:
116
- - SAMEORIGIN
117
- X-Xss-Protection:
118
- - 1; mode=block
119
- X-Content-Type-Options:
120
- - nosniff
121
- Content-Type:
122
- - application/json; charset=utf-8
123
- Cache-Control:
124
- - no-cache
125
- X-Request-Id:
126
- - 02154aab-00a9-42b4-83a8-b9c99c32a3a7
127
- X-Runtime:
128
- - '0.014950'
129
- Date:
130
- - Thu, 27 Aug 2015 08:26:21 GMT
131
- Connection:
132
- - close
133
- body:
134
- encoding: UTF-8
135
- string: '{"error":{"type":"invalid_request_error","message":"No badge exists
136
- with id: create-badge-for-destroy-test","status":404}}'
137
- http_version:
138
- recorded_at: Thu, 27 Aug 2015 08:26:21 GMT
139
- - request:
140
- method: post
141
- uri: http://gamification-api.dev/v1/badges
142
- body:
143
- encoding: UTF-8
144
- string: badge%5Bcollection_id%5D=1&badge%5Bdescription%5D=This+is+a+new+badge&badge%5Bhint%5D=Love+us..&badge%5Blevel%5D=bronze&badge%5Bname%5D=Create+Badge+for+Destroy&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
145
- headers:
146
- User-Agent:
147
- - Faraday v0.9.1
148
- Authorization:
149
- - Token token="c9cde524238644fa93393159e5e9ad87"
150
- Content-Type:
151
- - application/x-www-form-urlencoded
152
- Accept-Encoding:
153
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
154
- Accept:
155
- - "*/*"
156
- response:
157
- status:
158
- code: 201
159
- message: Created
160
- headers:
161
- X-Frame-Options:
162
- - SAMEORIGIN
163
- X-Xss-Protection:
164
- - 1; mode=block
165
- X-Content-Type-Options:
166
- - nosniff
167
- Content-Type:
168
- - application/json; charset=utf-8
169
- Etag:
170
- - '"f677c1a72db7b4a618661da0556a6c9b"'
171
- Cache-Control:
172
- - max-age=0, private, must-revalidate
173
- X-Request-Id:
174
- - 35f78a79-3cfb-442f-ac10-b59a19f811fa
175
- X-Runtime:
176
- - '0.092150'
177
- Date:
178
- - Thu, 03 Sep 2015 10:55:55 GMT
179
- Connection:
180
- - close
181
- body:
182
- encoding: UTF-8
183
- string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
184
- need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:55.545Z","updated_at":"2015-09-03T10:55:55.545Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
185
- http_version:
186
- recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
187
- - request:
188
- method: delete
189
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
190
- body:
191
- encoding: US-ASCII
192
- string: ''
193
- headers:
194
- User-Agent:
195
- - Faraday v0.9.1
196
- Authorization:
197
- - Token token="c9cde524238644fa93393159e5e9ad87"
198
- Accept-Encoding:
199
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
200
- Accept:
201
- - "*/*"
202
- response:
203
- status:
204
- code: 200
205
- message: OK
206
- headers:
207
- X-Frame-Options:
208
- - SAMEORIGIN
209
- X-Xss-Protection:
210
- - 1; mode=block
211
- X-Content-Type-Options:
212
- - nosniff
213
- Content-Type:
214
- - application/json; charset=utf-8
215
- Etag:
216
- - '"f677c1a72db7b4a618661da0556a6c9b"'
217
- Cache-Control:
218
- - max-age=0, private, must-revalidate
219
- X-Request-Id:
220
- - 79266fe8-3eb1-4ec3-9a0a-83923351bf64
221
- X-Runtime:
222
- - '0.026594'
223
- Date:
224
- - Thu, 03 Sep 2015 10:55:55 GMT
225
- Connection:
226
- - close
227
- body:
228
- encoding: UTF-8
229
- string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
230
- need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:55.545Z","updated_at":"2015-09-03T10:55:55.545Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
231
- http_version:
232
- recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
233
- - request:
234
- method: delete
235
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
236
- body:
237
- encoding: US-ASCII
238
- string: ''
239
- headers:
240
- User-Agent:
241
- - Faraday v0.9.1
242
- Authorization:
243
- - Token token="c9cde524238644fa93393159e5e9ad87"
244
- Accept-Encoding:
245
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
246
- Accept:
247
- - "*/*"
248
- response:
249
- status:
250
- code: 404
251
- message: Not Found
252
- headers:
253
- X-Frame-Options:
254
- - SAMEORIGIN
255
- X-Xss-Protection:
256
- - 1; mode=block
257
- X-Content-Type-Options:
258
- - nosniff
259
- Content-Type:
260
- - application/json; charset=utf-8
261
- Cache-Control:
262
- - no-cache
263
- X-Request-Id:
264
- - d131b46d-5cba-49e2-abd5-976d91b061b2
265
- X-Runtime:
266
- - '0.012085'
267
- Date:
268
- - Thu, 03 Sep 2015 10:55:55 GMT
269
- Connection:
270
- - close
271
- body:
272
- encoding: UTF-8
273
- string: '{"error":{"type":"invalid_request_error","message":"No badge exists
274
- with id: create-badge-for-destroy","status":404}}'
275
- http_version:
276
- recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
277
- recorded_with: VCR 2.9.3
@@ -1,231 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: delete
5
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy-error
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
- - '"053561c84fda77a31f0659418c46c131"'
33
- Cache-Control:
34
- - max-age=0, private, must-revalidate
35
- X-Request-Id:
36
- - fe0582aa-fc10-4cf7-bef4-0eefa11b7e09
37
- X-Runtime:
38
- - '0.034529'
39
- Date:
40
- - Thu, 27 Aug 2015 08:26:21 GMT
41
- Connection:
42
- - close
43
- body:
44
- encoding: UTF-8
45
- string: '{"name":"Create Badge for Destroy Error","description":"This is a new
46
- badge","requirements":"You need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy-error/badge.png","collection_id":"library","created_at":"2015-08-27T08:26:21.818Z","updated_at":"2015-08-27T08:26:21.818Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy-error"}'
47
- http_version:
48
- recorded_at: Thu, 27 Aug 2015 08:26:21 GMT
49
- - request:
50
- method: delete
51
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy-error
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: 404
67
- message: Not Found
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
- Cache-Control:
78
- - no-cache
79
- X-Request-Id:
80
- - 4cde3b36-3ef5-49ef-b742-d226ab0dd18d
81
- X-Runtime:
82
- - '0.015227'
83
- Date:
84
- - Thu, 27 Aug 2015 08:26:21 GMT
85
- Connection:
86
- - close
87
- body:
88
- encoding: UTF-8
89
- string: '{"error":{"type":"invalid_request_error","message":"No badge exists
90
- with id: create-badge-for-destroy-error","status":404}}'
91
- http_version:
92
- recorded_at: Thu, 27 Aug 2015 08:26:21 GMT
93
- - request:
94
- method: post
95
- uri: http://gamification-api.dev/v1/badges
96
- body:
97
- encoding: UTF-8
98
- string: badge%5Bcollection_id%5D=1&badge%5Bdescription%5D=This+is+a+new+badge&badge%5Bhint%5D=Love+us..&badge%5Blevel%5D=bronze&badge%5Bname%5D=Create+Badge+for+Destroy&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
99
- headers:
100
- User-Agent:
101
- - Faraday v0.9.1
102
- Authorization:
103
- - Token token="c9cde524238644fa93393159e5e9ad87"
104
- Content-Type:
105
- - application/x-www-form-urlencoded
106
- Accept-Encoding:
107
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
108
- Accept:
109
- - "*/*"
110
- response:
111
- status:
112
- code: 201
113
- message: Created
114
- headers:
115
- X-Frame-Options:
116
- - SAMEORIGIN
117
- X-Xss-Protection:
118
- - 1; mode=block
119
- X-Content-Type-Options:
120
- - nosniff
121
- Content-Type:
122
- - application/json; charset=utf-8
123
- Etag:
124
- - '"31cf2bcf227b08104c9598f02bdd0fdc"'
125
- Cache-Control:
126
- - max-age=0, private, must-revalidate
127
- X-Request-Id:
128
- - 82129026-599c-4bba-9995-0c7f000b6d4b
129
- X-Runtime:
130
- - '0.094930'
131
- Date:
132
- - Thu, 03 Sep 2015 10:55:55 GMT
133
- Connection:
134
- - close
135
- body:
136
- encoding: UTF-8
137
- string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
138
- need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:55.759Z","updated_at":"2015-09-03T10:55:55.759Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
139
- http_version:
140
- recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
141
- - request:
142
- method: delete
143
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
144
- body:
145
- encoding: US-ASCII
146
- string: ''
147
- headers:
148
- User-Agent:
149
- - Faraday v0.9.1
150
- Authorization:
151
- - Token token="c9cde524238644fa93393159e5e9ad87"
152
- Accept-Encoding:
153
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
154
- Accept:
155
- - "*/*"
156
- response:
157
- status:
158
- code: 200
159
- message: OK
160
- headers:
161
- X-Frame-Options:
162
- - SAMEORIGIN
163
- X-Xss-Protection:
164
- - 1; mode=block
165
- X-Content-Type-Options:
166
- - nosniff
167
- Content-Type:
168
- - application/json; charset=utf-8
169
- Etag:
170
- - '"31cf2bcf227b08104c9598f02bdd0fdc"'
171
- Cache-Control:
172
- - max-age=0, private, must-revalidate
173
- X-Request-Id:
174
- - 4d36b83f-1bdc-43ac-b090-e62647d9ee1a
175
- X-Runtime:
176
- - '0.030035'
177
- Date:
178
- - Thu, 03 Sep 2015 10:55:55 GMT
179
- Connection:
180
- - close
181
- body:
182
- encoding: UTF-8
183
- string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
184
- need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:55.759Z","updated_at":"2015-09-03T10:55:55.759Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
185
- http_version:
186
- recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
187
- - request:
188
- method: delete
189
- uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
190
- body:
191
- encoding: US-ASCII
192
- string: ''
193
- headers:
194
- User-Agent:
195
- - Faraday v0.9.1
196
- Authorization:
197
- - Token token="c9cde524238644fa93393159e5e9ad87"
198
- Accept-Encoding:
199
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
200
- Accept:
201
- - "*/*"
202
- response:
203
- status:
204
- code: 404
205
- message: Not Found
206
- headers:
207
- X-Frame-Options:
208
- - SAMEORIGIN
209
- X-Xss-Protection:
210
- - 1; mode=block
211
- X-Content-Type-Options:
212
- - nosniff
213
- Content-Type:
214
- - application/json; charset=utf-8
215
- Cache-Control:
216
- - no-cache
217
- X-Request-Id:
218
- - a11f4cf5-03f2-40ab-bcbf-db7b4beae052
219
- X-Runtime:
220
- - '0.012267'
221
- Date:
222
- - Thu, 03 Sep 2015 10:55:55 GMT
223
- Connection:
224
- - close
225
- body:
226
- encoding: UTF-8
227
- string: '{"error":{"type":"invalid_request_error","message":"No badge exists
228
- with id: create-badge-for-destroy","status":404}}'
229
- http_version:
230
- recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
231
- recorded_with: VCR 2.9.3