badgeapi 0.3.10 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.rubocop.yml +147 -0
- data/README.md +44 -12
- data/Rakefile +24 -11
- data/badgeapi.gemspec +23 -22
- data/lib/badgeapi/badge.rb +24 -27
- data/lib/badgeapi/badgeapi_object.rb +160 -147
- data/lib/badgeapi/collection.rb +6 -9
- data/lib/badgeapi/errors/api_error.rb +3 -4
- data/lib/badgeapi/errors/badgeapi_error.rb +15 -15
- data/lib/badgeapi/errors/invalid_request_error.rb +3 -4
- data/lib/badgeapi/recipient.rb +13 -16
- data/lib/badgeapi/version.rb +1 -1
- data/lib/badgeapi.rb +13 -15
- data/test/badge/badge_test.rb +71 -150
- data/test/badgeapi_test.rb +4 -0
- data/test/collection/collection_test.rb +43 -77
- data/test/fixtures/badge_all.yml +113 -0
- data/test/fixtures/{bad_api_key.yml → badge_all_bad_user.yml} +14 -13
- data/test/fixtures/{all_badges_bad_user.yml → badge_all_badges_bad_user.yml} +16 -57
- data/test/fixtures/badge_all_expanded.yml +184 -0
- data/test/fixtures/badge_all_from_collection.yml +52 -0
- data/test/fixtures/badge_all_issued.yml +99 -0
- data/test/fixtures/{all_badges_limited.yml → badge_all_limited.yml} +10 -8
- data/test/fixtures/{create_badge.yml → badge_create.yml} +20 -16
- data/test/fixtures/{create_new_badge_failure.yml → badge_create_new.yml} +28 -22
- data/test/fixtures/badge_destroy.yml +147 -0
- data/test/fixtures/badge_destroy_error.yml +147 -0
- data/test/fixtures/badge_error.yml +54 -6
- data/test/fixtures/{issue_badge_to_bad_user.yml → badge_issue_to_bad_user.yml} +8 -6
- data/test/fixtures/badge_issue_to_user.yml +107 -0
- data/test/fixtures/{issue_badge_to_user_with_library_card.yml → badge_issue_to_user_with_library_card.yml} +21 -17
- data/test/fixtures/{one_badge.yml → badge_one.yml} +10 -8
- data/test/fixtures/{one_badge_expanded.yml → badge_one_expanded.yml} +11 -9
- data/test/fixtures/badge_requirements.yml +150 -105
- data/test/fixtures/badge_revoke_from_user.yml +107 -0
- data/test/fixtures/{update_badge_via_update.yml → badge_update_via_update.yml} +31 -25
- data/test/fixtures/{update_badge_via_update_slug_history.yml → badge_update_via_update_slug_history.yml} +41 -33
- data/test/fixtures/{all_collection.yml → collection_all.yml} +11 -9
- data/test/fixtures/collection_all_expanded.yml +123 -0
- data/test/fixtures/{all_collection_limit.yml → collection_all_limit.yml} +10 -8
- data/test/fixtures/{create_collection.yml → collection_create.yml} +20 -16
- data/test/fixtures/{create_new_collection_failure.yml → collection_create_new_failure.yml} +36 -28
- data/test/fixtures/{destroy_collection.yml → collection_destroy.yml} +36 -28
- data/test/fixtures/{destroy_collection_error.yml → collection_destroy_error.yml} +36 -28
- data/test/fixtures/collection_error.yml +108 -12
- data/test/fixtures/{one_collection.yml → collection_one.yml} +10 -8
- data/test/fixtures/collection_one_expanded.yml +106 -0
- data/test/fixtures/{update_collection.yml → collection_update.yml} +40 -32
- data/test/fixtures/{update_collection_via_update.yml → collection_update_via_update.yml} +30 -24
- data/test/fixtures/{bad_Recipietn_request.yml → recipient_bad_user_data.yml} +26 -22
- data/test/fixtures/recipient_with_badges.yml +20 -108
- data/test/fixtures/recipient_with_badges_unicard.yml +151 -8
- data/test/recipient/recipient_test.rb +11 -29
- metadata +69 -73
- data/test/fixtures/all_badges.yml +0 -121
- data/test/fixtures/all_badges_expanded.yml +0 -196
- data/test/fixtures/all_badges_from_collection.yml +0 -52
- data/test/fixtures/all_badges_issued.yml +0 -430
- data/test/fixtures/all_collection_expanded.yml +0 -131
- data/test/fixtures/bad_Recipient.yml +0 -183
- data/test/fixtures/destroy_badge.yml +0 -277
- data/test/fixtures/destroy_badge_error.yml +0 -231
- data/test/fixtures/issue_already_owned_badge.yml +0 -49
- data/test/fixtures/issue_badge_to_user.yml +0 -199
- data/test/fixtures/one_collection_expanded.yml +0 -104
- data/test/fixtures/revoke_badge_from_user.yml +0 -199
- data/test/fixtures/revoke_badge_not_issued.yml +0 -49
@@ -1,49 +0,0 @@
|
|
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
|
@@ -1,199 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://gamification-api.dev/v1/badges/3/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: 200
|
23
|
-
message: OK
|
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
|
-
- '"aeb1dc320dbf15761c7cd0f017c85dcb"'
|
35
|
-
Cache-Control:
|
36
|
-
- max-age=0, private, must-revalidate
|
37
|
-
X-Request-Id:
|
38
|
-
- 20220236-9edd-4601-8699-f3fec8f8bb03
|
39
|
-
X-Runtime:
|
40
|
-
- '0.034771'
|
41
|
-
Date:
|
42
|
-
- Thu, 16 Jul 2015 09:30:11 GMT
|
43
|
-
Connection:
|
44
|
-
- close
|
45
|
-
body:
|
46
|
-
encoding: UTF-8
|
47
|
-
string: '[{"name":"Book Worm","description":"You have loaned out over 25 books.
|
48
|
-
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"}]'
|
49
|
-
http_version:
|
50
|
-
recorded_at: Thu, 16 Jul 2015 09:30:11 GMT
|
51
|
-
- request:
|
52
|
-
method: post
|
53
|
-
uri: http://gamification-api.dev/v1/badges/2/issue
|
54
|
-
body:
|
55
|
-
encoding: UTF-8
|
56
|
-
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
57
|
-
headers:
|
58
|
-
User-Agent:
|
59
|
-
- Faraday v0.9.1
|
60
|
-
Authorization:
|
61
|
-
- Token token="c9cde524238644fa93393159e5e9ad87"
|
62
|
-
Content-Type:
|
63
|
-
- application/x-www-form-urlencoded
|
64
|
-
Accept-Encoding:
|
65
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
66
|
-
Accept:
|
67
|
-
- "*/*"
|
68
|
-
response:
|
69
|
-
status:
|
70
|
-
code: 200
|
71
|
-
message: OK
|
72
|
-
headers:
|
73
|
-
X-Frame-Options:
|
74
|
-
- SAMEORIGIN
|
75
|
-
X-Xss-Protection:
|
76
|
-
- 1; mode=block
|
77
|
-
X-Content-Type-Options:
|
78
|
-
- nosniff
|
79
|
-
Content-Type:
|
80
|
-
- application/json; charset=utf-8
|
81
|
-
Etag:
|
82
|
-
- '"aeb1dc320dbf15761c7cd0f017c85dcb"'
|
83
|
-
Cache-Control:
|
84
|
-
- max-age=0, private, must-revalidate
|
85
|
-
X-Request-Id:
|
86
|
-
- 70f03472-0632-4e06-b986-38088e133f20
|
87
|
-
X-Runtime:
|
88
|
-
- '0.032332'
|
89
|
-
Date:
|
90
|
-
- Thu, 16 Jul 2015 09:48:02 GMT
|
91
|
-
Connection:
|
92
|
-
- close
|
93
|
-
body:
|
94
|
-
encoding: UTF-8
|
95
|
-
string: '[{"name":"Book Worm","description":"You have loaned out over 25 books.
|
96
|
-
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"}]'
|
97
|
-
http_version:
|
98
|
-
recorded_at: Thu, 16 Jul 2015 09:48:02 GMT
|
99
|
-
- request:
|
100
|
-
method: post
|
101
|
-
uri: http://gamification-api.dev/v1/badges/mega-book-worm/issue
|
102
|
-
body:
|
103
|
-
encoding: UTF-8
|
104
|
-
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
105
|
-
headers:
|
106
|
-
User-Agent:
|
107
|
-
- Faraday v0.9.1
|
108
|
-
Authorization:
|
109
|
-
- Token token="c9cde524238644fa93393159e5e9ad87"
|
110
|
-
Content-Type:
|
111
|
-
- application/x-www-form-urlencoded
|
112
|
-
Accept-Encoding:
|
113
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
114
|
-
Accept:
|
115
|
-
- "*/*"
|
116
|
-
response:
|
117
|
-
status:
|
118
|
-
code: 200
|
119
|
-
message: OK
|
120
|
-
headers:
|
121
|
-
X-Frame-Options:
|
122
|
-
- SAMEORIGIN
|
123
|
-
X-Xss-Protection:
|
124
|
-
- 1; mode=block
|
125
|
-
X-Content-Type-Options:
|
126
|
-
- nosniff
|
127
|
-
Content-Type:
|
128
|
-
- application/json; charset=utf-8
|
129
|
-
Etag:
|
130
|
-
- '"6b3a403d534c0bf8bd5bd2f898e210a9"'
|
131
|
-
Cache-Control:
|
132
|
-
- max-age=0, private, must-revalidate
|
133
|
-
X-Request-Id:
|
134
|
-
- 4c5128aa-aeb8-4792-a9c0-51517a23b08a
|
135
|
-
X-Runtime:
|
136
|
-
- '0.043567'
|
137
|
-
Date:
|
138
|
-
- Thu, 03 Sep 2015 10:55:58 GMT
|
139
|
-
Connection:
|
140
|
-
- close
|
141
|
-
body:
|
142
|
-
encoding: UTF-8
|
143
|
-
string: '{"total_score":75,"badges_total":2,"bronze_count":1,"silver_count":1,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
144
|
-
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
145
|
-
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","points":25,"object":"badge","issued_at":"2015-09-03T10:51:08.232Z","id":"book-worm"},{"name":"Mega
|
146
|
-
Book Worm","description":"You have loaned out 50 books.","requirements":"Loan
|
147
|
-
out 50 books","hint":"You must really like books...","image":"http://gamification-api.dev/badge_images/mega-book-worm/badge.png","collection_id":"library","created_at":"2015-09-03T10:51:07.899Z","updated_at":"2015-09-03T10:51:07.899Z","level":"silver","auto_issue":false,"status":"live","points":50,"object":"badge","issued_at":"2015-09-03T10:55:58.892Z","id":"mega-book-worm"}]}'
|
148
|
-
http_version:
|
149
|
-
recorded_at: Thu, 03 Sep 2015 10:55:58 GMT
|
150
|
-
- request:
|
151
|
-
method: post
|
152
|
-
uri: http://gamification-api.dev/v1/badges/mega-book-worm/revoke
|
153
|
-
body:
|
154
|
-
encoding: UTF-8
|
155
|
-
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
156
|
-
headers:
|
157
|
-
User-Agent:
|
158
|
-
- Faraday v0.9.1
|
159
|
-
Authorization:
|
160
|
-
- Token token="c9cde524238644fa93393159e5e9ad87"
|
161
|
-
Content-Type:
|
162
|
-
- application/x-www-form-urlencoded
|
163
|
-
Accept-Encoding:
|
164
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
165
|
-
Accept:
|
166
|
-
- "*/*"
|
167
|
-
response:
|
168
|
-
status:
|
169
|
-
code: 200
|
170
|
-
message: OK
|
171
|
-
headers:
|
172
|
-
X-Frame-Options:
|
173
|
-
- SAMEORIGIN
|
174
|
-
X-Xss-Protection:
|
175
|
-
- 1; mode=block
|
176
|
-
X-Content-Type-Options:
|
177
|
-
- nosniff
|
178
|
-
Content-Type:
|
179
|
-
- application/json; charset=utf-8
|
180
|
-
Etag:
|
181
|
-
- '"b580cf4171303fd650475e570ec9458a"'
|
182
|
-
Cache-Control:
|
183
|
-
- max-age=0, private, must-revalidate
|
184
|
-
X-Request-Id:
|
185
|
-
- 0746c586-2c87-4415-a416-e6fc0f16b14c
|
186
|
-
X-Runtime:
|
187
|
-
- '0.032023'
|
188
|
-
Date:
|
189
|
-
- Thu, 03 Sep 2015 10:55:58 GMT
|
190
|
-
Connection:
|
191
|
-
- close
|
192
|
-
body:
|
193
|
-
encoding: UTF-8
|
194
|
-
string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
195
|
-
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
196
|
-
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","points":25,"object":"badge","issued_at":"2015-09-03T10:51:08.232Z","id":"book-worm"}]}'
|
197
|
-
http_version:
|
198
|
-
recorded_at: Thu, 03 Sep 2015 10:55:58 GMT
|
199
|
-
recorded_with: VCR 2.9.3
|
@@ -1,104 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://gamification-api.dev/v1/collections/1?expand=badges
|
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
|
-
- '"a0990dfa58df94224e82022780291483"'
|
33
|
-
Cache-Control:
|
34
|
-
- max-age=0, private, must-revalidate
|
35
|
-
X-Request-Id:
|
36
|
-
- 1da543c6-0b32-46a5-ad4b-6479dfc1f170
|
37
|
-
X-Runtime:
|
38
|
-
- '0.026573'
|
39
|
-
Date:
|
40
|
-
- Thu, 03 Sep 2015 10:59:41 GMT
|
41
|
-
Connection:
|
42
|
-
- close
|
43
|
-
body:
|
44
|
-
encoding: ASCII-8BIT
|
45
|
-
string: !binary |-
|
46
|
-
eyJpZCI6ImxpYnJhcnkiLCJuYW1lIjoiTGlicmFyeSIsImRlc2NyaXB0aW9u
|
47
|
-
IjoiVXNlIHlvdXIgbGlicmFyeSBhbmQgZWFybiBiYWRnZXMiLCJjcmVhdGVk
|
48
|
-
X2F0IjoiMjAxNS0wOS0wM1QxMDo1MTowNy43NDdaIiwidXBkYXRlZF9hdCI6
|
49
|
-
IjIwMTUtMDktMDNUMTA6NTE6MDcuNzQ3WiIsInRvdGFsX3BvaW50c19hdmFp
|
50
|
-
bGFibGUiOjEyNSwiYmFkZ2VfY291bnQiOjQsIm9iamVjdCI6ImNvbGxlY3Rp
|
51
|
-
b24iLCJiYWRnZXMiOlt7Im5hbWUiOiJCb29rIFdvcm0iLCJkZXNjcmlwdGlv
|
52
|
-
biI6IllvdSBoYXZlIGxvYW5lZCBvdXQgb3ZlciAyNSBib29rcy4gTmljZSBn
|
53
|
-
b2luZyEiLCJyZXF1aXJlbWVudHMiOiJMb2FuIG91dCAyNSBib29rcyIsImhp
|
54
|
-
bnQiOiJZb3UgbXVzdCBsaWtlIGJvb2tzLi4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9pbnRzIjoyNSwib2JqZWN0
|
101
|
-
IjoiYmFkZ2UiLCJpZCI6Im91ci1iZXN0LWZyaWVuZCJ9XX0=
|
102
|
-
http_version:
|
103
|
-
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
104
|
-
recorded_with: VCR 2.9.3
|
@@ -1,199 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://gamification-api.dev/v1/badges/2/revoke
|
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: 200
|
23
|
-
message: OK
|
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
|
-
- '"3514db33f344216321fef093b35aabe2"'
|
35
|
-
Cache-Control:
|
36
|
-
- max-age=0, private, must-revalidate
|
37
|
-
X-Request-Id:
|
38
|
-
- 291de80f-0b4f-4029-ba3e-639aae1ce8e4
|
39
|
-
X-Runtime:
|
40
|
-
- '0.032299'
|
41
|
-
Date:
|
42
|
-
- Thu, 16 Jul 2015 09:30:12 GMT
|
43
|
-
Connection:
|
44
|
-
- close
|
45
|
-
body:
|
46
|
-
encoding: UTF-8
|
47
|
-
string: '[{"name":"Book Worm","description":"You have loaned out over 25 books.
|
48
|
-
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"},{"name":"Night
|
49
|
-
Owl","description":"You loaned a book out between Midnight and 5 o''clock","requirements":"Loan
|
50
|
-
out a book between 00:00 - 5:00","hint":"It must be late...","image":"http://gamification-api.dev/uploads/badge/image/3/seed.png","collection_id":"library","created_at":"2015-07-16T09:21:22.605Z","updated_at":"2015-07-16T09:21:22.605Z","level":"bronze","image_greyscale":"http://gamification-api.dev/uploads/badge/image/3/grey_seed.png","required_badges":[],"points":25,"id":"night-owl"}]'
|
51
|
-
http_version:
|
52
|
-
recorded_at: Thu, 16 Jul 2015 09:30:12 GMT
|
53
|
-
- request:
|
54
|
-
method: post
|
55
|
-
uri: http://gamification-api.dev/v1/badges/2/issue
|
56
|
-
body:
|
57
|
-
encoding: UTF-8
|
58
|
-
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
59
|
-
headers:
|
60
|
-
User-Agent:
|
61
|
-
- Faraday v0.9.1
|
62
|
-
Authorization:
|
63
|
-
- Token token="c9cde524238644fa93393159e5e9ad87"
|
64
|
-
Content-Type:
|
65
|
-
- application/x-www-form-urlencoded
|
66
|
-
Accept-Encoding:
|
67
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
68
|
-
Accept:
|
69
|
-
- "*/*"
|
70
|
-
response:
|
71
|
-
status:
|
72
|
-
code: 400
|
73
|
-
message: Bad Request
|
74
|
-
headers:
|
75
|
-
X-Frame-Options:
|
76
|
-
- SAMEORIGIN
|
77
|
-
X-Xss-Protection:
|
78
|
-
- 1; mode=block
|
79
|
-
X-Content-Type-Options:
|
80
|
-
- nosniff
|
81
|
-
Content-Type:
|
82
|
-
- application/json; charset=utf-8
|
83
|
-
Cache-Control:
|
84
|
-
- no-cache
|
85
|
-
X-Request-Id:
|
86
|
-
- 9b2037e2-e370-417a-880e-06e07a73db19
|
87
|
-
X-Runtime:
|
88
|
-
- '0.020210'
|
89
|
-
Date:
|
90
|
-
- Thu, 16 Jul 2015 09:42:11 GMT
|
91
|
-
Connection:
|
92
|
-
- close
|
93
|
-
body:
|
94
|
-
encoding: UTF-8
|
95
|
-
string: '{"error":{"type":"invalid_request_error","message":"Cannot issue badge:
|
96
|
-
Mega Book Worm. The user has already been issued this badge","status":400}}'
|
97
|
-
http_version:
|
98
|
-
recorded_at: Thu, 16 Jul 2015 09:42:11 GMT
|
99
|
-
- request:
|
100
|
-
method: post
|
101
|
-
uri: http://gamification-api.dev/v1/badges/mega-book-worm/issue
|
102
|
-
body:
|
103
|
-
encoding: UTF-8
|
104
|
-
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
105
|
-
headers:
|
106
|
-
User-Agent:
|
107
|
-
- Faraday v0.9.1
|
108
|
-
Authorization:
|
109
|
-
- Token token="c9cde524238644fa93393159e5e9ad87"
|
110
|
-
Content-Type:
|
111
|
-
- application/x-www-form-urlencoded
|
112
|
-
Accept-Encoding:
|
113
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
114
|
-
Accept:
|
115
|
-
- "*/*"
|
116
|
-
response:
|
117
|
-
status:
|
118
|
-
code: 200
|
119
|
-
message: OK
|
120
|
-
headers:
|
121
|
-
X-Frame-Options:
|
122
|
-
- SAMEORIGIN
|
123
|
-
X-Xss-Protection:
|
124
|
-
- 1; mode=block
|
125
|
-
X-Content-Type-Options:
|
126
|
-
- nosniff
|
127
|
-
Content-Type:
|
128
|
-
- application/json; charset=utf-8
|
129
|
-
Etag:
|
130
|
-
- '"645fdcd9ef4b502bd16d080088875170"'
|
131
|
-
Cache-Control:
|
132
|
-
- max-age=0, private, must-revalidate
|
133
|
-
X-Request-Id:
|
134
|
-
- a53e3dec-5855-4690-9e0a-3c4483663786
|
135
|
-
X-Runtime:
|
136
|
-
- '0.044444'
|
137
|
-
Date:
|
138
|
-
- Thu, 03 Sep 2015 10:56:00 GMT
|
139
|
-
Connection:
|
140
|
-
- close
|
141
|
-
body:
|
142
|
-
encoding: UTF-8
|
143
|
-
string: '{"total_score":75,"badges_total":2,"bronze_count":1,"silver_count":1,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
144
|
-
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
145
|
-
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","points":25,"object":"badge","issued_at":"2015-09-03T10:51:08.232Z","id":"book-worm"},{"name":"Mega
|
146
|
-
Book Worm","description":"You have loaned out 50 books.","requirements":"Loan
|
147
|
-
out 50 books","hint":"You must really like books...","image":"http://gamification-api.dev/badge_images/mega-book-worm/badge.png","collection_id":"library","created_at":"2015-09-03T10:51:07.899Z","updated_at":"2015-09-03T10:51:07.899Z","level":"silver","auto_issue":false,"status":"live","points":50,"object":"badge","issued_at":"2015-09-03T10:56:00.871Z","id":"mega-book-worm"}]}'
|
148
|
-
http_version:
|
149
|
-
recorded_at: Thu, 03 Sep 2015 10:56:00 GMT
|
150
|
-
- request:
|
151
|
-
method: post
|
152
|
-
uri: http://gamification-api.dev/v1/badges/mega-book-worm/revoke
|
153
|
-
body:
|
154
|
-
encoding: UTF-8
|
155
|
-
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
156
|
-
headers:
|
157
|
-
User-Agent:
|
158
|
-
- Faraday v0.9.1
|
159
|
-
Authorization:
|
160
|
-
- Token token="c9cde524238644fa93393159e5e9ad87"
|
161
|
-
Content-Type:
|
162
|
-
- application/x-www-form-urlencoded
|
163
|
-
Accept-Encoding:
|
164
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
165
|
-
Accept:
|
166
|
-
- "*/*"
|
167
|
-
response:
|
168
|
-
status:
|
169
|
-
code: 200
|
170
|
-
message: OK
|
171
|
-
headers:
|
172
|
-
X-Frame-Options:
|
173
|
-
- SAMEORIGIN
|
174
|
-
X-Xss-Protection:
|
175
|
-
- 1; mode=block
|
176
|
-
X-Content-Type-Options:
|
177
|
-
- nosniff
|
178
|
-
Content-Type:
|
179
|
-
- application/json; charset=utf-8
|
180
|
-
Etag:
|
181
|
-
- '"b580cf4171303fd650475e570ec9458a"'
|
182
|
-
Cache-Control:
|
183
|
-
- max-age=0, private, must-revalidate
|
184
|
-
X-Request-Id:
|
185
|
-
- 81a6812c-712d-485d-8fba-6ad8679735a8
|
186
|
-
X-Runtime:
|
187
|
-
- '0.031274'
|
188
|
-
Date:
|
189
|
-
- Thu, 03 Sep 2015 10:56:00 GMT
|
190
|
-
Connection:
|
191
|
-
- close
|
192
|
-
body:
|
193
|
-
encoding: UTF-8
|
194
|
-
string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
195
|
-
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
196
|
-
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","points":25,"object":"badge","issued_at":"2015-09-03T10:51:08.232Z","id":"book-worm"}]}'
|
197
|
-
http_version:
|
198
|
-
recorded_at: Thu, 03 Sep 2015 10:56:00 GMT
|
199
|
-
recorded_with: VCR 2.9.3
|
@@ -1,49 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://gamification-api.dev/v1/badges/3/revoke
|
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
|
-
- 5c042623-58e2-4cac-aea0-a2cf291e16ba
|
37
|
-
X-Runtime:
|
38
|
-
- '0.025164'
|
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 revoke badge:
|
46
|
-
Night Owl. The user has not previously 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
|