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
@@ -0,0 +1,147 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://gamification-api.dev/v1/badges
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
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
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
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
|
+
Strict-Transport-Security:
|
26
|
+
- max-age=31536000
|
27
|
+
X-Frame-Options:
|
28
|
+
- SAMEORIGIN
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Content-Type:
|
34
|
+
- application/json; charset=utf-8
|
35
|
+
Etag:
|
36
|
+
- '"b2aeeaa59bd4de417cfc69f0055fa2c8"'
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
X-Request-Id:
|
40
|
+
- 51c94fc7-9d16-4f94-bd1a-710b244955d4
|
41
|
+
X-Runtime:
|
42
|
+
- '4.987678'
|
43
|
+
Date:
|
44
|
+
- Thu, 19 Nov 2015 15:40:46 GMT
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
50
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:41.495Z","updated_at":"2015-11-19T15:40:41.495Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Thu, 19 Nov 2015 15:40:46 GMT
|
53
|
+
- request:
|
54
|
+
method: delete
|
55
|
+
uri: https://gamification-api.dev/v1/badges/create-badge-for-destroy
|
56
|
+
body:
|
57
|
+
encoding: US-ASCII
|
58
|
+
string: ''
|
59
|
+
headers:
|
60
|
+
User-Agent:
|
61
|
+
- Faraday v0.9.2
|
62
|
+
Authorization:
|
63
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
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
|
+
Strict-Transport-Security:
|
74
|
+
- max-age=31536000
|
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
|
+
Etag:
|
84
|
+
- '"b2aeeaa59bd4de417cfc69f0055fa2c8"'
|
85
|
+
Cache-Control:
|
86
|
+
- max-age=0, private, must-revalidate
|
87
|
+
X-Request-Id:
|
88
|
+
- 437419d7-1d60-44eb-822b-23372d426a57
|
89
|
+
X-Runtime:
|
90
|
+
- '0.027295'
|
91
|
+
Date:
|
92
|
+
- Thu, 19 Nov 2015 15:40:46 GMT
|
93
|
+
Connection:
|
94
|
+
- close
|
95
|
+
body:
|
96
|
+
encoding: UTF-8
|
97
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
98
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:41.495Z","updated_at":"2015-11-19T15:40:41.495Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
99
|
+
http_version:
|
100
|
+
recorded_at: Thu, 19 Nov 2015 15:40:46 GMT
|
101
|
+
- request:
|
102
|
+
method: delete
|
103
|
+
uri: https://gamification-api.dev/v1/badges/create-badge-for-destroy
|
104
|
+
body:
|
105
|
+
encoding: US-ASCII
|
106
|
+
string: ''
|
107
|
+
headers:
|
108
|
+
User-Agent:
|
109
|
+
- Faraday v0.9.2
|
110
|
+
Authorization:
|
111
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
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: 404
|
119
|
+
message: Not Found
|
120
|
+
headers:
|
121
|
+
Strict-Transport-Security:
|
122
|
+
- max-age=31536000
|
123
|
+
X-Frame-Options:
|
124
|
+
- SAMEORIGIN
|
125
|
+
X-Xss-Protection:
|
126
|
+
- 1; mode=block
|
127
|
+
X-Content-Type-Options:
|
128
|
+
- nosniff
|
129
|
+
Content-Type:
|
130
|
+
- application/json; charset=utf-8
|
131
|
+
Cache-Control:
|
132
|
+
- no-cache
|
133
|
+
X-Request-Id:
|
134
|
+
- 20bc9e88-7cec-40c6-9214-c369c3cbc99a
|
135
|
+
X-Runtime:
|
136
|
+
- '0.010723'
|
137
|
+
Date:
|
138
|
+
- Thu, 19 Nov 2015 15:40:46 GMT
|
139
|
+
Connection:
|
140
|
+
- close
|
141
|
+
body:
|
142
|
+
encoding: UTF-8
|
143
|
+
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
144
|
+
with id: create-badge-for-destroy","status":404}}'
|
145
|
+
http_version:
|
146
|
+
recorded_at: Thu, 19 Nov 2015 15:40:46 GMT
|
147
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,147 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://gamification-api.dev/v1/badges
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
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
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
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
|
+
Strict-Transport-Security:
|
26
|
+
- max-age=31536000
|
27
|
+
X-Frame-Options:
|
28
|
+
- SAMEORIGIN
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Content-Type:
|
34
|
+
- application/json; charset=utf-8
|
35
|
+
Etag:
|
36
|
+
- '"468ca70041c4ffb5f8ced193f78029a6"'
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
X-Request-Id:
|
40
|
+
- 689ab9d9-8ae5-43c8-9b5b-283da6f7c6de
|
41
|
+
X-Runtime:
|
42
|
+
- '5.502053'
|
43
|
+
Date:
|
44
|
+
- Thu, 19 Nov 2015 15:40:52 GMT
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
50
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:46.677Z","updated_at":"2015-11-19T15:40:46.677Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Thu, 19 Nov 2015 15:40:52 GMT
|
53
|
+
- request:
|
54
|
+
method: delete
|
55
|
+
uri: https://gamification-api.dev/v1/badges/create-badge-for-destroy
|
56
|
+
body:
|
57
|
+
encoding: US-ASCII
|
58
|
+
string: ''
|
59
|
+
headers:
|
60
|
+
User-Agent:
|
61
|
+
- Faraday v0.9.2
|
62
|
+
Authorization:
|
63
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
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
|
+
Strict-Transport-Security:
|
74
|
+
- max-age=31536000
|
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
|
+
Etag:
|
84
|
+
- '"468ca70041c4ffb5f8ced193f78029a6"'
|
85
|
+
Cache-Control:
|
86
|
+
- max-age=0, private, must-revalidate
|
87
|
+
X-Request-Id:
|
88
|
+
- 1a8e02fc-9592-4ffa-bc56-1f34f38356bc
|
89
|
+
X-Runtime:
|
90
|
+
- '0.030015'
|
91
|
+
Date:
|
92
|
+
- Thu, 19 Nov 2015 15:40:52 GMT
|
93
|
+
Connection:
|
94
|
+
- close
|
95
|
+
body:
|
96
|
+
encoding: UTF-8
|
97
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
98
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:46.677Z","updated_at":"2015-11-19T15:40:46.677Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
99
|
+
http_version:
|
100
|
+
recorded_at: Thu, 19 Nov 2015 15:40:52 GMT
|
101
|
+
- request:
|
102
|
+
method: delete
|
103
|
+
uri: https://gamification-api.dev/v1/badges/create-badge-for-destroy
|
104
|
+
body:
|
105
|
+
encoding: US-ASCII
|
106
|
+
string: ''
|
107
|
+
headers:
|
108
|
+
User-Agent:
|
109
|
+
- Faraday v0.9.2
|
110
|
+
Authorization:
|
111
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
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: 404
|
119
|
+
message: Not Found
|
120
|
+
headers:
|
121
|
+
Strict-Transport-Security:
|
122
|
+
- max-age=31536000
|
123
|
+
X-Frame-Options:
|
124
|
+
- SAMEORIGIN
|
125
|
+
X-Xss-Protection:
|
126
|
+
- 1; mode=block
|
127
|
+
X-Content-Type-Options:
|
128
|
+
- nosniff
|
129
|
+
Content-Type:
|
130
|
+
- application/json; charset=utf-8
|
131
|
+
Cache-Control:
|
132
|
+
- no-cache
|
133
|
+
X-Request-Id:
|
134
|
+
- 1825e052-487c-4ccf-95d3-b5ef3cda3979
|
135
|
+
X-Runtime:
|
136
|
+
- '0.016843'
|
137
|
+
Date:
|
138
|
+
- Thu, 19 Nov 2015 15:40:52 GMT
|
139
|
+
Connection:
|
140
|
+
- close
|
141
|
+
body:
|
142
|
+
encoding: UTF-8
|
143
|
+
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
144
|
+
with id: create-badge-for-destroy","status":404}}'
|
145
|
+
http_version:
|
146
|
+
recorded_at: Thu, 19 Nov 2015 15:40:52 GMT
|
147
|
+
recorded_with: VCR 2.9.3
|
@@ -2,13 +2,13 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://gamification-api.dev/v1/badges/27
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Faraday v0.9.
|
11
|
+
- Faraday v0.9.2
|
12
12
|
Authorization:
|
13
13
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
14
|
Accept-Encoding:
|
@@ -20,6 +20,8 @@ http_interactions:
|
|
20
20
|
code: 404
|
21
21
|
message: Not Found
|
22
22
|
headers:
|
23
|
+
Strict-Transport-Security:
|
24
|
+
- max-age=31536000
|
23
25
|
X-Frame-Options:
|
24
26
|
- SAMEORIGIN
|
25
27
|
X-Xss-Protection:
|
@@ -31,11 +33,11 @@ http_interactions:
|
|
31
33
|
Cache-Control:
|
32
34
|
- no-cache
|
33
35
|
X-Request-Id:
|
34
|
-
-
|
36
|
+
- 0ae945eb-c9a3-481e-95cf-175ccd008f8d
|
35
37
|
X-Runtime:
|
36
|
-
- '0.
|
38
|
+
- '0.014233'
|
37
39
|
Date:
|
38
|
-
- Thu,
|
40
|
+
- Thu, 19 Nov 2015 15:24:12 GMT
|
39
41
|
Connection:
|
40
42
|
- close
|
41
43
|
body:
|
@@ -43,5 +45,51 @@ http_interactions:
|
|
43
45
|
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
44
46
|
with id: 27","status":404}}'
|
45
47
|
http_version:
|
46
|
-
recorded_at: Thu,
|
48
|
+
recorded_at: Thu, 19 Nov 2015 15:24:12 GMT
|
49
|
+
- request:
|
50
|
+
method: get
|
51
|
+
uri: https://gamification-api.dev/v1/badges/safasuf2
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ''
|
55
|
+
headers:
|
56
|
+
User-Agent:
|
57
|
+
- Faraday v0.9.2
|
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
|
+
Strict-Transport-Security:
|
70
|
+
- max-age=31536000
|
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
|
+
Cache-Control:
|
80
|
+
- no-cache
|
81
|
+
X-Request-Id:
|
82
|
+
- 901aa21d-dd87-45c6-a6cb-c0a54973b6e1
|
83
|
+
X-Runtime:
|
84
|
+
- '0.017487'
|
85
|
+
Date:
|
86
|
+
- Thu, 19 Nov 2015 15:41:09 GMT
|
87
|
+
Connection:
|
88
|
+
- close
|
89
|
+
body:
|
90
|
+
encoding: UTF-8
|
91
|
+
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
92
|
+
with id: safasuf2","status":404}}'
|
93
|
+
http_version:
|
94
|
+
recorded_at: Thu, 19 Nov 2015 15:41:09 GMT
|
47
95
|
recorded_with: VCR 2.9.3
|
@@ -2,13 +2,13 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://gamification-api.dev/v1/badges/2/issue
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: recipient=t.skarbek-wazynski
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Faraday v0.9.
|
11
|
+
- Faraday v0.9.2
|
12
12
|
Authorization:
|
13
13
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
14
|
Content-Type:
|
@@ -22,6 +22,8 @@ http_interactions:
|
|
22
22
|
code: 404
|
23
23
|
message: Not Found
|
24
24
|
headers:
|
25
|
+
Strict-Transport-Security:
|
26
|
+
- max-age=31536000
|
25
27
|
X-Frame-Options:
|
26
28
|
- SAMEORIGIN
|
27
29
|
X-Xss-Protection:
|
@@ -33,11 +35,11 @@ http_interactions:
|
|
33
35
|
Cache-Control:
|
34
36
|
- no-cache
|
35
37
|
X-Request-Id:
|
36
|
-
-
|
38
|
+
- 1714a0ea-6d5c-43e4-a75f-79cbcec385a1
|
37
39
|
X-Runtime:
|
38
|
-
- '0.
|
40
|
+
- '0.020792'
|
39
41
|
Date:
|
40
|
-
- Thu,
|
42
|
+
- Thu, 19 Nov 2015 15:41:29 GMT
|
41
43
|
Connection:
|
42
44
|
- close
|
43
45
|
body:
|
@@ -46,5 +48,5 @@ http_interactions:
|
|
46
48
|
user with specified data t.skarbek-wazynski. Recipient data must be a university
|
47
49
|
email address, university card number or username.","status":404}}'
|
48
50
|
http_version:
|
49
|
-
recorded_at: Thu,
|
51
|
+
recorded_at: Thu, 19 Nov 2015 15:41:29 GMT
|
50
52
|
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,107 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://gamification-api.dev/v1/badges/mega-book-worm/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.2
|
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
|
+
Strict-Transport-Security:
|
26
|
+
- max-age=31536000
|
27
|
+
X-Frame-Options:
|
28
|
+
- SAMEORIGIN
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Content-Type:
|
34
|
+
- application/json; charset=utf-8
|
35
|
+
Etag:
|
36
|
+
- '"900ff07f719871ac8e35eaf466528bec"'
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
X-Request-Id:
|
40
|
+
- f4ffd0dc-4558-42fd-a586-2677d237b4b1
|
41
|
+
X-Runtime:
|
42
|
+
- '0.073706'
|
43
|
+
Date:
|
44
|
+
- Thu, 19 Nov 2015 15:41:29 GMT
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"total_score":75,"badges_total":2,"bronze_count":1,"silver_count":1,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
50
|
+
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
51
|
+
out 25 books","hint":"You must like books...","image":"https://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:39:58.956Z","updated_at":"2015-11-18T11:39:58.956Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-18T11:40:26.379Z","id":"book-worm"},{"name":"Mega
|
52
|
+
Book Worm","description":"You have loaned out 50 books.","requirements":"Loan
|
53
|
+
out 50 books","hint":"You must really like books...","image":"https://gamification-api.dev/badge_images/mega-book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:40:05.068Z","updated_at":"2015-11-18T11:40:05.068Z","level":"silver","auto_issue":false,"status":"live","points":50,"object":"badge","issued_at":"2015-11-19T15:41:29.880Z","id":"mega-book-worm"}]}'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Thu, 19 Nov 2015 15:41:29 GMT
|
56
|
+
- request:
|
57
|
+
method: post
|
58
|
+
uri: https://gamification-api.dev/v1/badges/mega-book-worm/revoke
|
59
|
+
body:
|
60
|
+
encoding: UTF-8
|
61
|
+
string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
|
62
|
+
headers:
|
63
|
+
User-Agent:
|
64
|
+
- Faraday v0.9.2
|
65
|
+
Authorization:
|
66
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
67
|
+
Content-Type:
|
68
|
+
- application/x-www-form-urlencoded
|
69
|
+
Accept-Encoding:
|
70
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
71
|
+
Accept:
|
72
|
+
- "*/*"
|
73
|
+
response:
|
74
|
+
status:
|
75
|
+
code: 200
|
76
|
+
message: OK
|
77
|
+
headers:
|
78
|
+
Strict-Transport-Security:
|
79
|
+
- max-age=31536000
|
80
|
+
X-Frame-Options:
|
81
|
+
- SAMEORIGIN
|
82
|
+
X-Xss-Protection:
|
83
|
+
- 1; mode=block
|
84
|
+
X-Content-Type-Options:
|
85
|
+
- nosniff
|
86
|
+
Content-Type:
|
87
|
+
- application/json; charset=utf-8
|
88
|
+
Etag:
|
89
|
+
- '"365681d5132a5e92b7946178e30b2356"'
|
90
|
+
Cache-Control:
|
91
|
+
- max-age=0, private, must-revalidate
|
92
|
+
X-Request-Id:
|
93
|
+
- a26b801a-c182-4c18-bff1-d52aeda487e3
|
94
|
+
X-Runtime:
|
95
|
+
- '0.056401'
|
96
|
+
Date:
|
97
|
+
- Thu, 19 Nov 2015 15:41:30 GMT
|
98
|
+
Connection:
|
99
|
+
- close
|
100
|
+
body:
|
101
|
+
encoding: UTF-8
|
102
|
+
string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
103
|
+
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
104
|
+
out 25 books","hint":"You must like books...","image":"https://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:39:58.956Z","updated_at":"2015-11-18T11:39:58.956Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-18T11:40:26.379Z","id":"book-worm"}]}'
|
105
|
+
http_version:
|
106
|
+
recorded_at: Thu, 19 Nov 2015 15:41:30 GMT
|
107
|
+
recorded_with: VCR 2.9.3
|
@@ -2,13 +2,13 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://gamification-api.dev/v1/badges/3/issue
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: recipient=0043181
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Faraday v0.9.
|
11
|
+
- Faraday v0.9.2
|
12
12
|
Authorization:
|
13
13
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
14
|
Content-Type:
|
@@ -22,6 +22,8 @@ http_interactions:
|
|
22
22
|
code: 200
|
23
23
|
message: OK
|
24
24
|
headers:
|
25
|
+
Strict-Transport-Security:
|
26
|
+
- max-age=31536000
|
25
27
|
X-Frame-Options:
|
26
28
|
- SAMEORIGIN
|
27
29
|
X-Xss-Protection:
|
@@ -31,35 +33,35 @@ http_interactions:
|
|
31
33
|
Content-Type:
|
32
34
|
- application/json; charset=utf-8
|
33
35
|
Etag:
|
34
|
-
- '"
|
36
|
+
- '"7fa307a20aa3c3c1124cf44839fead7b"'
|
35
37
|
Cache-Control:
|
36
38
|
- max-age=0, private, must-revalidate
|
37
39
|
X-Request-Id:
|
38
|
-
-
|
40
|
+
- c350884b-04d0-4519-b84d-eb9045d12e41
|
39
41
|
X-Runtime:
|
40
|
-
- '
|
42
|
+
- '1.499314'
|
41
43
|
Date:
|
42
|
-
- Thu,
|
44
|
+
- Thu, 19 Nov 2015 15:41:31 GMT
|
43
45
|
Connection:
|
44
46
|
- close
|
45
47
|
body:
|
46
48
|
encoding: UTF-8
|
47
49
|
string: '{"total_score":50,"badges_total":2,"bronze_count":2,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
48
50
|
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
49
|
-
out 25 books","hint":"You must like books...","image":"
|
51
|
+
out 25 books","hint":"You must like books...","image":"https://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:39:58.956Z","updated_at":"2015-11-18T11:39:58.956Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-18T11:40:26.379Z","id":"book-worm"},{"name":"Night
|
50
52
|
Owl","description":"You loaned a book out between Midnight and 5 o''clock","requirements":"Loan
|
51
|
-
out a book between 00:00 - 5:00","hint":"It must be late...","image":"
|
53
|
+
out a book between 00:00 - 5:00","hint":"It must be late...","image":"https://gamification-api.dev/badge_images/night-owl/badge.png","collection_id":"library","created_at":"2015-11-18T11:40:10.176Z","updated_at":"2015-11-18T11:40:10.176Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-19T15:41:31.641Z","id":"night-owl"}]}'
|
52
54
|
http_version:
|
53
|
-
recorded_at: Thu,
|
55
|
+
recorded_at: Thu, 19 Nov 2015 15:41:31 GMT
|
54
56
|
- request:
|
55
57
|
method: post
|
56
|
-
uri:
|
58
|
+
uri: https://gamification-api.dev/v1/badges/3/revoke
|
57
59
|
body:
|
58
60
|
encoding: UTF-8
|
59
61
|
string: recipient=0043181
|
60
62
|
headers:
|
61
63
|
User-Agent:
|
62
|
-
- Faraday v0.9.
|
64
|
+
- Faraday v0.9.2
|
63
65
|
Authorization:
|
64
66
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
65
67
|
Content-Type:
|
@@ -73,6 +75,8 @@ http_interactions:
|
|
73
75
|
code: 200
|
74
76
|
message: OK
|
75
77
|
headers:
|
78
|
+
Strict-Transport-Security:
|
79
|
+
- max-age=31536000
|
76
80
|
X-Frame-Options:
|
77
81
|
- SAMEORIGIN
|
78
82
|
X-Xss-Protection:
|
@@ -82,22 +86,22 @@ http_interactions:
|
|
82
86
|
Content-Type:
|
83
87
|
- application/json; charset=utf-8
|
84
88
|
Etag:
|
85
|
-
- '"
|
89
|
+
- '"365681d5132a5e92b7946178e30b2356"'
|
86
90
|
Cache-Control:
|
87
91
|
- max-age=0, private, must-revalidate
|
88
92
|
X-Request-Id:
|
89
|
-
-
|
93
|
+
- 852d39f4-d688-4f9f-a269-374626e4f905
|
90
94
|
X-Runtime:
|
91
|
-
- '
|
95
|
+
- '1.506485'
|
92
96
|
Date:
|
93
|
-
- Thu,
|
97
|
+
- Thu, 19 Nov 2015 15:41:33 GMT
|
94
98
|
Connection:
|
95
99
|
- close
|
96
100
|
body:
|
97
101
|
encoding: UTF-8
|
98
102
|
string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
|
99
103
|
Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
|
100
|
-
out 25 books","hint":"You must like books...","image":"
|
104
|
+
out 25 books","hint":"You must like books...","image":"https://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:39:58.956Z","updated_at":"2015-11-18T11:39:58.956Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-18T11:40:26.379Z","id":"book-worm"}]}'
|
101
105
|
http_version:
|
102
|
-
recorded_at: Thu,
|
106
|
+
recorded_at: Thu, 19 Nov 2015 15:41:33 GMT
|
103
107
|
recorded_with: VCR 2.9.3
|