badgeapi 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +15 -0
- data/badgeapi.gemspec +33 -0
- data/lib/badgeapi/badge.rb +29 -0
- data/lib/badgeapi/badgeapi_object.rb +149 -0
- data/lib/badgeapi/collection.rb +10 -0
- data/lib/badgeapi/errors/api_error.rb +5 -0
- data/lib/badgeapi/errors/badgeapi_error.rb +18 -0
- data/lib/badgeapi/errors/invalid_request_error.rb +5 -0
- data/lib/badgeapi/recipient.rb +18 -0
- data/lib/badgeapi/version.rb +3 -0
- data/lib/badgeapi.rb +36 -0
- data/test/badge/badge_test.rb +469 -0
- data/test/badgeapi_test.rb +20 -0
- data/test/collection/collection_test.rb +275 -0
- data/test/fixtures/all_badges.yml +121 -0
- data/test/fixtures/all_badges_bad_user.yml +138 -0
- data/test/fixtures/all_badges_expanded.yml +196 -0
- data/test/fixtures/all_badges_from_collection.yml +52 -0
- data/test/fixtures/all_badges_issued.yml +430 -0
- data/test/fixtures/all_badges_limited.yml +49 -0
- data/test/fixtures/all_collection.yml +50 -0
- data/test/fixtures/all_collection_expanded.yml +131 -0
- data/test/fixtures/all_collection_limit.yml +49 -0
- data/test/fixtures/bad_Recipient.yml +183 -0
- data/test/fixtures/bad_Recipietn_request.yml +93 -0
- data/test/fixtures/bad_api_key.yml +49 -0
- data/test/fixtures/badge_error.yml +47 -0
- data/test/fixtures/badge_requirements.yml +351 -0
- data/test/fixtures/collection_error.yml +91 -0
- data/test/fixtures/create_badge.yml +97 -0
- data/test/fixtures/create_collection.yml +97 -0
- data/test/fixtures/create_new_badge_failure.yml +143 -0
- data/test/fixtures/create_new_collection_failure.yml +189 -0
- data/test/fixtures/destroy_badge.yml +277 -0
- data/test/fixtures/destroy_badge_error.yml +231 -0
- data/test/fixtures/destroy_collection.yml +185 -0
- data/test/fixtures/destroy_collection_error.yml +185 -0
- data/test/fixtures/issue_already_owned_badge.yml +49 -0
- data/test/fixtures/issue_badge_to_bad_user.yml +50 -0
- data/test/fixtures/issue_badge_to_user.yml +199 -0
- data/test/fixtures/issue_badge_to_user_with_library_card.yml +103 -0
- data/test/fixtures/one_badge.yml +49 -0
- data/test/fixtures/one_badge_expanded.yml +50 -0
- data/test/fixtures/one_collection.yml +49 -0
- data/test/fixtures/one_collection_expanded.yml +104 -0
- data/test/fixtures/recipient_with_badges.yml +187 -0
- data/test/fixtures/recipient_with_badges_unicard.yml +50 -0
- data/test/fixtures/revoke_badge_from_user.yml +199 -0
- data/test/fixtures/revoke_badge_not_issued.yml +49 -0
- data/test/fixtures/update_badge_via_update.yml +145 -0
- data/test/fixtures/update_badge_via_update_slug_history.yml +191 -0
- data/test/fixtures/update_collection.yml +191 -0
- data/test/fixtures/update_collection_via_update.yml +145 -0
- data/test/recipient/recipient_test.rb +108 -0
- data/test/test_helper.rb +11 -0
- metadata +274 -0
@@ -0,0 +1,231 @@
|
|
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
|
@@ -0,0 +1,185 @@
|
|
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+badge&collection%5Bname%5D=Create+Collection+for+Destroy
|
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
|
+
- '"fc74c7a17abcdc3e486c80504e235141"'
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=0, private, must-revalidate
|
37
|
+
X-Request-Id:
|
38
|
+
- 5357dbe5-94b3-4a44-82e0-e906ee583dcf
|
39
|
+
X-Runtime:
|
40
|
+
- '0.026766'
|
41
|
+
Date:
|
42
|
+
- Thu, 03 Sep 2015 10:59:40 GMT
|
43
|
+
Connection:
|
44
|
+
- close
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"id":"create-collection-for-destroy","name":"Create Collection for
|
48
|
+
Destroy","description":"This is a new badge","created_at":"2015-09-03T10:59:40.840Z","updated_at":"2015-09-03T10:59:40.840Z","total_points_available":0,"badge_count":0,"object":"collection"}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Thu, 03 Sep 2015 10:59:40 GMT
|
51
|
+
- request:
|
52
|
+
method: delete
|
53
|
+
uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy
|
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
|
+
- '"fc74c7a17abcdc3e486c80504e235141"'
|
81
|
+
Cache-Control:
|
82
|
+
- max-age=0, private, must-revalidate
|
83
|
+
X-Request-Id:
|
84
|
+
- 667a66ad-223d-4640-9f05-1073ed5487cd
|
85
|
+
X-Runtime:
|
86
|
+
- '0.018918'
|
87
|
+
Date:
|
88
|
+
- Thu, 03 Sep 2015 10:59:40 GMT
|
89
|
+
Connection:
|
90
|
+
- close
|
91
|
+
body:
|
92
|
+
encoding: UTF-8
|
93
|
+
string: '{"id":"create-collection-for-destroy","name":"Create Collection for
|
94
|
+
Destroy","description":"This is a new badge","created_at":"2015-09-03T10:59:40.840Z","updated_at":"2015-09-03T10:59:40.840Z","total_points_available":0,"badge_count":0,"object":"collection"}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Thu, 03 Sep 2015 10:59:40 GMT
|
97
|
+
- request:
|
98
|
+
method: get
|
99
|
+
uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy
|
100
|
+
body:
|
101
|
+
encoding: US-ASCII
|
102
|
+
string: ''
|
103
|
+
headers:
|
104
|
+
User-Agent:
|
105
|
+
- Faraday v0.9.1
|
106
|
+
Authorization:
|
107
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
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: 404
|
115
|
+
message: Not Found
|
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
|
+
- 44523245-fdbf-4173-835c-04c6b360f7ea
|
129
|
+
X-Runtime:
|
130
|
+
- '0.009577'
|
131
|
+
Date:
|
132
|
+
- Thu, 03 Sep 2015 10:59:40 GMT
|
133
|
+
Connection:
|
134
|
+
- close
|
135
|
+
body:
|
136
|
+
encoding: UTF-8
|
137
|
+
string: '{"error":{"type":"invalid_request_error","message":"No collection exists
|
138
|
+
with id: create-collection-for-destroy","status":404}}'
|
139
|
+
http_version:
|
140
|
+
recorded_at: Thu, 03 Sep 2015 10:59:40 GMT
|
141
|
+
- request:
|
142
|
+
method: get
|
143
|
+
uri: http://gamification-api.dev/v1/collections/create-collection-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: 404
|
159
|
+
message: Not Found
|
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
|
+
Cache-Control:
|
170
|
+
- no-cache
|
171
|
+
X-Request-Id:
|
172
|
+
- 975ce324-8f23-4f59-b84b-26370cf852a3
|
173
|
+
X-Runtime:
|
174
|
+
- '0.009605'
|
175
|
+
Date:
|
176
|
+
- Thu, 03 Sep 2015 10:59:40 GMT
|
177
|
+
Connection:
|
178
|
+
- close
|
179
|
+
body:
|
180
|
+
encoding: UTF-8
|
181
|
+
string: '{"error":{"type":"invalid_request_error","message":"No collection exists
|
182
|
+
with id: create-collection-for-destroy","status":404}}'
|
183
|
+
http_version:
|
184
|
+
recorded_at: Thu, 03 Sep 2015 10:59:40 GMT
|
185
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,185 @@
|
|
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+badge&collection%5Bname%5D=Create+Collection+for+Destroy
|
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
|
+
- '"40e59c79ac39d206256cddb4de019e9c"'
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=0, private, must-revalidate
|
37
|
+
X-Request-Id:
|
38
|
+
- ff7536f0-4454-4920-80ab-48ef0dd2ac12
|
39
|
+
X-Runtime:
|
40
|
+
- '0.024840'
|
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-for-destroy","name":"Create Collection for
|
48
|
+
Destroy","description":"This is a new badge","created_at":"2015-09-03T10:59:40.992Z","updated_at":"2015-09-03T10:59:40.992Z","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-for-destroy
|
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
|
+
- '"40e59c79ac39d206256cddb4de019e9c"'
|
81
|
+
Cache-Control:
|
82
|
+
- max-age=0, private, must-revalidate
|
83
|
+
X-Request-Id:
|
84
|
+
- 7c1cf019-7969-4b1e-af9a-0eb945ee6943
|
85
|
+
X-Runtime:
|
86
|
+
- '0.018188'
|
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-for-destroy","name":"Create Collection for
|
94
|
+
Destroy","description":"This is a new badge","created_at":"2015-09-03T10:59:40.992Z","updated_at":"2015-09-03T10:59:40.992Z","total_points_available":0,"badge_count":0,"object":"collection"}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
97
|
+
- request:
|
98
|
+
method: delete
|
99
|
+
uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy
|
100
|
+
body:
|
101
|
+
encoding: US-ASCII
|
102
|
+
string: ''
|
103
|
+
headers:
|
104
|
+
User-Agent:
|
105
|
+
- Faraday v0.9.1
|
106
|
+
Authorization:
|
107
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
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: 404
|
115
|
+
message: Not Found
|
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
|
+
- 138327b5-70b6-4743-9b66-2816c726fa22
|
129
|
+
X-Runtime:
|
130
|
+
- '0.010726'
|
131
|
+
Date:
|
132
|
+
- Thu, 03 Sep 2015 10:59:41 GMT
|
133
|
+
Connection:
|
134
|
+
- close
|
135
|
+
body:
|
136
|
+
encoding: UTF-8
|
137
|
+
string: '{"error":{"type":"invalid_request_error","message":"No collection exists
|
138
|
+
with id: create-collection-for-destroy","status":404}}'
|
139
|
+
http_version:
|
140
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
141
|
+
- request:
|
142
|
+
method: delete
|
143
|
+
uri: http://gamification-api.dev/v1/collections/create-collection-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: 404
|
159
|
+
message: Not Found
|
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
|
+
Cache-Control:
|
170
|
+
- no-cache
|
171
|
+
X-Request-Id:
|
172
|
+
- f3c50575-7d56-4e74-b8bd-5169aeae8d28
|
173
|
+
X-Runtime:
|
174
|
+
- '0.011182'
|
175
|
+
Date:
|
176
|
+
- Thu, 03 Sep 2015 10:59:41 GMT
|
177
|
+
Connection:
|
178
|
+
- close
|
179
|
+
body:
|
180
|
+
encoding: UTF-8
|
181
|
+
string: '{"error":{"type":"invalid_request_error","message":"No collection exists
|
182
|
+
with id: create-collection-for-destroy","status":404}}'
|
183
|
+
http_version:
|
184
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
185
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://gamification-api.dev/v1/badges/1/issue
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
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: 400
|
23
|
+
message: Bad Request
|
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
|
+
- 63802396-3073-4c44-bb6a-ecf896f805a3
|
37
|
+
X-Runtime:
|
38
|
+
- '0.029672'
|
39
|
+
Date:
|
40
|
+
- Thu, 03 Sep 2015 10:55:58 GMT
|
41
|
+
Connection:
|
42
|
+
- close
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"error":{"type":"invalid_request_error","message":"Cannot issue badge:
|
46
|
+
Book Worm. The user has already been issued this badge","status":400}}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Thu, 03 Sep 2015 10:55:58 GMT
|
49
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://gamification-api.dev/v1/badges/2/issue
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: recipient=t.skarbek-wazynski
|
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
|
+
- 1ea889a7-b7d1-485c-bba0-065a3b337001
|
37
|
+
X-Runtime:
|
38
|
+
- '0.021360'
|
39
|
+
Date:
|
40
|
+
- Thu, 03 Sep 2015 10:55:58 GMT
|
41
|
+
Connection:
|
42
|
+
- close
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"error":{"type":"invalid_request_error","message":"Unable to find
|
46
|
+
user with specified data t.skarbek-wazynski. Recipient data must be a university
|
47
|
+
email address, university card number or username.","status":404}}'
|
48
|
+
http_version:
|
49
|
+
recorded_at: Thu, 03 Sep 2015 10:55:58 GMT
|
50
|
+
recorded_with: VCR 2.9.3
|