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
@@ -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/1
|
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: 200
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
|
+
Strict-Transport-Security:
|
24
|
+
- max-age=31536000
|
23
25
|
X-Frame-Options:
|
24
26
|
- SAMEORIGIN
|
25
27
|
X-Xss-Protection:
|
@@ -29,21 +31,21 @@ http_interactions:
|
|
29
31
|
Content-Type:
|
30
32
|
- application/json; charset=utf-8
|
31
33
|
Etag:
|
32
|
-
- '"
|
34
|
+
- '"bf7d978a396c4d28179b1b9dcb8bccd5"'
|
33
35
|
Cache-Control:
|
34
36
|
- max-age=0, private, must-revalidate
|
35
37
|
X-Request-Id:
|
36
|
-
-
|
38
|
+
- a9ac26ca-cefa-43bd-ba83-00c3e5aa8e90
|
37
39
|
X-Runtime:
|
38
|
-
- '0.
|
40
|
+
- '0.014991'
|
39
41
|
Date:
|
40
|
-
- Thu,
|
42
|
+
- Thu, 19 Nov 2015 15:41:27 GMT
|
41
43
|
Connection:
|
42
44
|
- close
|
43
45
|
body:
|
44
46
|
encoding: UTF-8
|
45
47
|
string: '{"name":"Book Worm","description":"You have loaned out over 25 books.
|
46
|
-
Nice going!","requirements":"Loan out 25 books","hint":"You must like books...","image":"
|
48
|
+
Nice going!","requirements":"Loan 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","required_badges":[],"points":25,"object":"badge","id":"book-worm"}'
|
47
49
|
http_version:
|
48
|
-
recorded_at: Thu,
|
50
|
+
recorded_at: Thu, 19 Nov 2015 15:41:27 GMT
|
49
51
|
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/1?expand=collection
|
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: 200
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
|
+
Strict-Transport-Security:
|
24
|
+
- max-age=31536000
|
23
25
|
X-Frame-Options:
|
24
26
|
- SAMEORIGIN
|
25
27
|
X-Xss-Protection:
|
@@ -29,22 +31,22 @@ http_interactions:
|
|
29
31
|
Content-Type:
|
30
32
|
- application/json; charset=utf-8
|
31
33
|
Etag:
|
32
|
-
- '"
|
34
|
+
- '"39ba12dc263e2f289462422462930c7f"'
|
33
35
|
Cache-Control:
|
34
36
|
- max-age=0, private, must-revalidate
|
35
37
|
X-Request-Id:
|
36
|
-
-
|
38
|
+
- ac4c65d3-572b-4aa9-8217-8ea7bbfcd914
|
37
39
|
X-Runtime:
|
38
|
-
- '0.
|
40
|
+
- '0.017174'
|
39
41
|
Date:
|
40
|
-
- Thu,
|
42
|
+
- Thu, 19 Nov 2015 15:41:27 GMT
|
41
43
|
Connection:
|
42
44
|
- close
|
43
45
|
body:
|
44
46
|
encoding: UTF-8
|
45
47
|
string: '{"name":"Book Worm","description":"You have loaned out over 25 books.
|
46
|
-
Nice going!","requirements":"Loan out 25 books","hint":"You must like books...","image":"
|
47
|
-
your library and earn badges","created_at":"2015-
|
48
|
+
Nice going!","requirements":"Loan 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","required_badges":[],"points":25,"object":"badge","collection":{"id":"library","name":"Library","description":"Use
|
49
|
+
your library and earn badges","created_at":"2015-11-18T11:39:58.859Z","updated_at":"2015-11-18T11:39:58.859Z"},"id":"book-worm"}'
|
48
50
|
http_version:
|
49
|
-
recorded_at: Thu,
|
51
|
+
recorded_at: Thu, 19 Nov 2015 15:41:27 GMT
|
50
52
|
recorded_with: VCR 2.9.3
|
@@ -1,14 +1,63 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://gamification-api.dev/v1/badges/marathon-man
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
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
|
+
Strict-Transport-Security:
|
24
|
+
- max-age=31536000
|
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
|
+
- '"0fac1fb012ef81ead6788b7c45bad3f7"'
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=0, private, must-revalidate
|
37
|
+
X-Request-Id:
|
38
|
+
- e96ab2c8-7817-4d53-843f-868d57df7768
|
39
|
+
X-Runtime:
|
40
|
+
- '0.010140'
|
41
|
+
Date:
|
42
|
+
- Thu, 19 Nov 2015 15:31:06 GMT
|
43
|
+
Connection:
|
44
|
+
- close
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"name":"Marathon Man","description":"You have run 10 laps of the trips
|
48
|
+
trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
|
49
|
+
trail over any time","hint":"Keep going...","image":"https://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-11-18T11:40:20.303Z","updated_at":"2015-11-18T11:40:20.303Z","level":"gold","auto_issue":false,"status":"live","required_badges":[],"points":75,"object":"badge","id":"marathon-man"}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Thu, 19 Nov 2015 15:31:06 GMT
|
3
52
|
- request:
|
4
53
|
method: post
|
5
|
-
uri:
|
54
|
+
uri: https://gamification-api.dev/v1/badges/marathon-man/requires
|
6
55
|
body:
|
7
56
|
encoding: UTF-8
|
8
|
-
string: required_badge%5Bid%5D=
|
57
|
+
string: required_badge%5Bid%5D=you-trim-trailed
|
9
58
|
headers:
|
10
59
|
User-Agent:
|
11
|
-
- Faraday v0.9.
|
60
|
+
- Faraday v0.9.2
|
12
61
|
Authorization:
|
13
62
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
63
|
Content-Type:
|
@@ -22,6 +71,8 @@ http_interactions:
|
|
22
71
|
code: 404
|
23
72
|
message: Not Found
|
24
73
|
headers:
|
74
|
+
Strict-Transport-Security:
|
75
|
+
- max-age=31536000
|
25
76
|
X-Frame-Options:
|
26
77
|
- SAMEORIGIN
|
27
78
|
X-Xss-Protection:
|
@@ -33,39 +84,43 @@ http_interactions:
|
|
33
84
|
Cache-Control:
|
34
85
|
- no-cache
|
35
86
|
X-Request-Id:
|
36
|
-
-
|
87
|
+
- 52129633-1b5a-46ee-9ea8-2bdbcb8e32e3
|
37
88
|
X-Runtime:
|
38
|
-
- '0.
|
89
|
+
- '0.009989'
|
39
90
|
Date:
|
40
|
-
-
|
91
|
+
- Thu, 19 Nov 2015 15:31:06 GMT
|
41
92
|
Connection:
|
42
93
|
- close
|
43
94
|
body:
|
44
95
|
encoding: UTF-8
|
45
|
-
string: '{"error":{"type":"invalid_request_error","message":"
|
46
|
-
|
96
|
+
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
97
|
+
with id: you-trim-trailed","status":404}}'
|
47
98
|
http_version:
|
48
|
-
recorded_at:
|
99
|
+
recorded_at: Thu, 19 Nov 2015 15:31:06 GMT
|
49
100
|
- request:
|
50
|
-
method:
|
51
|
-
uri:
|
101
|
+
method: post
|
102
|
+
uri: https://gamification-api.dev/v1/badges
|
52
103
|
body:
|
53
|
-
encoding:
|
54
|
-
string:
|
104
|
+
encoding: UTF-8
|
105
|
+
string: badge%5Bcollection_id%5D=1&badge%5Bdescription%5D=This+is+a+new+badge&badge%5Bhint%5D=Love+us..&badge%5Blevel%5D=silver&badge%5Bname%5D=Create+Badge&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
|
55
106
|
headers:
|
56
107
|
User-Agent:
|
57
|
-
- Faraday v0.9.
|
108
|
+
- Faraday v0.9.2
|
58
109
|
Authorization:
|
59
110
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
111
|
+
Content-Type:
|
112
|
+
- application/x-www-form-urlencoded
|
60
113
|
Accept-Encoding:
|
61
114
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
62
115
|
Accept:
|
63
116
|
- "*/*"
|
64
117
|
response:
|
65
118
|
status:
|
66
|
-
code:
|
67
|
-
message:
|
119
|
+
code: 201
|
120
|
+
message: Created
|
68
121
|
headers:
|
122
|
+
Strict-Transport-Security:
|
123
|
+
- max-age=31536000
|
69
124
|
X-Frame-Options:
|
70
125
|
- SAMEORIGIN
|
71
126
|
X-Xss-Protection:
|
@@ -75,32 +130,32 @@ http_interactions:
|
|
75
130
|
Content-Type:
|
76
131
|
- application/json; charset=utf-8
|
77
132
|
Etag:
|
78
|
-
- '"
|
133
|
+
- '"832626c4208c709a5021b4d6073d56af"'
|
79
134
|
Cache-Control:
|
80
135
|
- max-age=0, private, must-revalidate
|
81
136
|
X-Request-Id:
|
82
|
-
-
|
137
|
+
- 87c73c71-1d44-47be-a217-2387726025f1
|
83
138
|
X-Runtime:
|
84
|
-
- '
|
139
|
+
- '8.377910'
|
85
140
|
Date:
|
86
|
-
-
|
141
|
+
- Thu, 19 Nov 2015 15:41:00 GMT
|
87
142
|
Connection:
|
88
143
|
- close
|
89
144
|
body:
|
90
145
|
encoding: UTF-8
|
91
|
-
string: '{"name":"
|
92
|
-
|
146
|
+
string: '{"name":"Create Badge","description":"This is a new badge","requirements":"You
|
147
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:52.393Z","updated_at":"2015-11-19T15:40:52.393Z","level":"silver","auto_issue":false,"status":"draft","required_badges":[],"points":50,"object":"badge","id":"create-badge"}'
|
93
148
|
http_version:
|
94
|
-
recorded_at:
|
149
|
+
recorded_at: Thu, 19 Nov 2015 15:41:00 GMT
|
95
150
|
- request:
|
96
151
|
method: post
|
97
|
-
uri:
|
152
|
+
uri: https://gamification-api.dev/v1/badges
|
98
153
|
body:
|
99
154
|
encoding: UTF-8
|
100
|
-
string:
|
155
|
+
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=Required+Badge&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
|
101
156
|
headers:
|
102
157
|
User-Agent:
|
103
|
-
- Faraday v0.9.
|
158
|
+
- Faraday v0.9.2
|
104
159
|
Authorization:
|
105
160
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
106
161
|
Content-Type:
|
@@ -111,9 +166,11 @@ http_interactions:
|
|
111
166
|
- "*/*"
|
112
167
|
response:
|
113
168
|
status:
|
114
|
-
code:
|
115
|
-
message:
|
169
|
+
code: 201
|
170
|
+
message: Created
|
116
171
|
headers:
|
172
|
+
Strict-Transport-Security:
|
173
|
+
- max-age=31536000
|
117
174
|
X-Frame-Options:
|
118
175
|
- SAMEORIGIN
|
119
176
|
X-Xss-Protection:
|
@@ -122,34 +179,37 @@ http_interactions:
|
|
122
179
|
- nosniff
|
123
180
|
Content-Type:
|
124
181
|
- application/json; charset=utf-8
|
182
|
+
Etag:
|
183
|
+
- '"389dd2b408111b119674762feb3a9f22"'
|
125
184
|
Cache-Control:
|
126
|
-
-
|
185
|
+
- max-age=0, private, must-revalidate
|
127
186
|
X-Request-Id:
|
128
|
-
-
|
187
|
+
- 5ba2fea9-deab-47e6-bccd-42e4876ad0fd
|
129
188
|
X-Runtime:
|
130
|
-
- '
|
189
|
+
- '7.800611'
|
131
190
|
Date:
|
132
|
-
-
|
191
|
+
- Thu, 19 Nov 2015 15:41:08 GMT
|
133
192
|
Connection:
|
134
193
|
- close
|
135
194
|
body:
|
136
195
|
encoding: UTF-8
|
137
|
-
string: '{"
|
138
|
-
|
139
|
-
Worm. Required badges can only be one-directional","status":422}}'
|
196
|
+
string: '{"name":"Required Badge","description":"This is a new badge","requirements":"You
|
197
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/required-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:00.844Z","updated_at":"2015-11-19T15:41:00.844Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"required-badge"}'
|
140
198
|
http_version:
|
141
|
-
recorded_at:
|
199
|
+
recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
|
142
200
|
- request:
|
143
|
-
method:
|
144
|
-
uri:
|
201
|
+
method: post
|
202
|
+
uri: https://gamification-api.dev/v1/badges/create-badge/requires
|
145
203
|
body:
|
146
|
-
encoding:
|
147
|
-
string:
|
204
|
+
encoding: UTF-8
|
205
|
+
string: required_badge%5Bid%5D=required-badge
|
148
206
|
headers:
|
149
207
|
User-Agent:
|
150
|
-
- Faraday v0.9.
|
208
|
+
- Faraday v0.9.2
|
151
209
|
Authorization:
|
152
210
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
211
|
+
Content-Type:
|
212
|
+
- application/x-www-form-urlencoded
|
153
213
|
Accept-Encoding:
|
154
214
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
155
215
|
Accept:
|
@@ -159,6 +219,8 @@ http_interactions:
|
|
159
219
|
code: 200
|
160
220
|
message: OK
|
161
221
|
headers:
|
222
|
+
Strict-Transport-Security:
|
223
|
+
- max-age=31536000
|
162
224
|
X-Frame-Options:
|
163
225
|
- SAMEORIGIN
|
164
226
|
X-Xss-Protection:
|
@@ -168,50 +230,34 @@ http_interactions:
|
|
168
230
|
Content-Type:
|
169
231
|
- application/json; charset=utf-8
|
170
232
|
Etag:
|
171
|
-
- '"
|
233
|
+
- '"d9fb2e750d6784649d62736ef151dc37"'
|
172
234
|
Cache-Control:
|
173
235
|
- max-age=0, private, must-revalidate
|
174
236
|
X-Request-Id:
|
175
|
-
-
|
237
|
+
- 36f1bfe3-88a2-41d1-8a0d-3218bc9461eb
|
176
238
|
X-Runtime:
|
177
|
-
- '0.
|
239
|
+
- '0.038161'
|
178
240
|
Date:
|
179
|
-
-
|
241
|
+
- Thu, 19 Nov 2015 15:41:08 GMT
|
180
242
|
Connection:
|
181
243
|
- close
|
182
244
|
body:
|
183
|
-
encoding:
|
184
|
-
string:
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
bGlrZSBib29rcy4uLiIsImltYWdlIjoiaHR0cDovL2dhbWlmaWNhdGlvbi1h
|
189
|
-
cGkuZGV2L2JhZGdlX2ltYWdlcy9ib29rLXdvcm0vYmFkZ2UucG5nIiwiY29s
|
190
|
-
bGVjdGlvbl9pZCI6ImxpYnJhcnkiLCJjcmVhdGVkX2F0IjoiMjAxNS0wNy0x
|
191
|
-
NlQwOToyMToyMi40NDhaIiwidXBkYXRlZF9hdCI6IjIwMTUtMDctMjRUMTU6
|
192
|
-
MjY6NDAuMDg2WiIsImxldmVsIjoiYnJvbnplIiwicmVxdWlyZWRfYmFkZ2Vz
|
193
|
-
IjpbeyJuYW1lIjoiT3VyIEJlc3QgRnJpZW5kIiwiZGVzY3JpcHRpb24iOiJZ
|
194
|
-
b3UgZGlkbid0IGdldCBhbnkgZmluZXMgaW4gdGhlIGxhc3QgMTIgbW9udGhz
|
195
|
-
ISIsInJlcXVpcmVtZW50cyI6IsKjMCBpbiBmaW5lcyBmb3IgdGhlIHBhc3Qg
|
196
|
-
MTIgbW9udGhzIiwiaGludCI6IkRvbid0IGdldCBpbiB0cm91YmxlIG5vdy4u
|
197
|
-
LiIsImltYWdlIjoiaHR0cDovL2dhbWlmaWNhdGlvbi1hcGkuZGV2L2JhZGdl
|
198
|
-
X2ltYWdlcy9vdXItYmVzdC1mcmllbmQvYmFkZ2UucG5nIiwiY29sbGVjdGlv
|
199
|
-
bl9pZCI6ImxpYnJhcnkiLCJjcmVhdGVkX2F0IjoiMjAxNS0wNy0xNlQwOToy
|
200
|
-
MToyMi42ODBaIiwidXBkYXRlZF9hdCI6IjIwMTUtMDctMTZUMDk6MjE6MjIu
|
201
|
-
NjgwWiIsImxldmVsIjoiYnJvbnplIiwicmVxdWlyZWRfYmFkZ2VzIjpbXSwi
|
202
|
-
cG9pbnRzIjoyNSwiaWQiOiJvdXItYmVzdC1mcmllbmQifV0sInBvaW50cyI6
|
203
|
-
MjUsImlkIjoiYm9vay13b3JtIn0=
|
245
|
+
encoding: UTF-8
|
246
|
+
string: '{"name":"Create Badge","description":"This is a new badge","requirements":"You
|
247
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:52.393Z","updated_at":"2015-11-19T15:40:52.393Z","level":"silver","auto_issue":false,"status":"draft","required_badges":[{"name":"Required
|
248
|
+
Badge","description":"This is a new badge","requirements":"You need to love
|
249
|
+
the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/required-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:00.844Z","updated_at":"2015-11-19T15:41:00.844Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"required-badge"}],"points":50,"object":"badge","id":"create-badge"}'
|
204
250
|
http_version:
|
205
|
-
recorded_at:
|
251
|
+
recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
|
206
252
|
- request:
|
207
|
-
method:
|
208
|
-
uri:
|
253
|
+
method: delete
|
254
|
+
uri: https://gamification-api.dev/v1/badges/create-badge/requires?required_badge%5Bid%5D=required-badge
|
209
255
|
body:
|
210
256
|
encoding: US-ASCII
|
211
257
|
string: ''
|
212
258
|
headers:
|
213
259
|
User-Agent:
|
214
|
-
- Faraday v0.9.
|
260
|
+
- Faraday v0.9.2
|
215
261
|
Authorization:
|
216
262
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
217
263
|
Accept-Encoding:
|
@@ -223,6 +269,8 @@ http_interactions:
|
|
223
269
|
code: 200
|
224
270
|
message: OK
|
225
271
|
headers:
|
272
|
+
Strict-Transport-Security:
|
273
|
+
- max-age=31536000
|
226
274
|
X-Frame-Options:
|
227
275
|
- SAMEORIGIN
|
228
276
|
X-Xss-Protection:
|
@@ -232,37 +280,34 @@ http_interactions:
|
|
232
280
|
Content-Type:
|
233
281
|
- application/json; charset=utf-8
|
234
282
|
Etag:
|
235
|
-
- '"
|
283
|
+
- '"832626c4208c709a5021b4d6073d56af"'
|
236
284
|
Cache-Control:
|
237
285
|
- max-age=0, private, must-revalidate
|
238
286
|
X-Request-Id:
|
239
|
-
-
|
287
|
+
- 3bd1bae7-556e-40b5-aebc-d6d7b0685cc6
|
240
288
|
X-Runtime:
|
241
|
-
- '0.
|
289
|
+
- '0.023086'
|
242
290
|
Date:
|
243
|
-
- Thu,
|
291
|
+
- Thu, 19 Nov 2015 15:41:08 GMT
|
244
292
|
Connection:
|
245
293
|
- close
|
246
294
|
body:
|
247
295
|
encoding: UTF-8
|
248
|
-
string: '{"name":"
|
249
|
-
|
250
|
-
trail over any time","hint":"Keep going...","image":"http://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.150Z","updated_at":"2015-09-03T10:51:08.150Z","level":"gold","auto_issue":false,"status":"live","required_badges":[],"points":75,"object":"badge","id":"marathon-man"}'
|
296
|
+
string: '{"name":"Create Badge","description":"This is a new badge","requirements":"You
|
297
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:52.393Z","updated_at":"2015-11-19T15:40:52.393Z","level":"silver","auto_issue":false,"status":"draft","required_badges":[],"points":50,"object":"badge","id":"create-badge"}'
|
251
298
|
http_version:
|
252
|
-
recorded_at: Thu,
|
299
|
+
recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
|
253
300
|
- request:
|
254
|
-
method:
|
255
|
-
uri:
|
301
|
+
method: delete
|
302
|
+
uri: https://gamification-api.dev/v1/badges/create-badge
|
256
303
|
body:
|
257
|
-
encoding:
|
258
|
-
string:
|
304
|
+
encoding: US-ASCII
|
305
|
+
string: ''
|
259
306
|
headers:
|
260
307
|
User-Agent:
|
261
|
-
- Faraday v0.9.
|
308
|
+
- Faraday v0.9.2
|
262
309
|
Authorization:
|
263
310
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
264
|
-
Content-Type:
|
265
|
-
- application/x-www-form-urlencoded
|
266
311
|
Accept-Encoding:
|
267
312
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
268
313
|
Accept:
|
@@ -272,6 +317,8 @@ http_interactions:
|
|
272
317
|
code: 200
|
273
318
|
message: OK
|
274
319
|
headers:
|
320
|
+
Strict-Transport-Security:
|
321
|
+
- max-age=31536000
|
275
322
|
X-Frame-Options:
|
276
323
|
- SAMEORIGIN
|
277
324
|
X-Xss-Protection:
|
@@ -281,35 +328,32 @@ http_interactions:
|
|
281
328
|
Content-Type:
|
282
329
|
- application/json; charset=utf-8
|
283
330
|
Etag:
|
284
|
-
- '"
|
331
|
+
- '"832626c4208c709a5021b4d6073d56af"'
|
285
332
|
Cache-Control:
|
286
333
|
- max-age=0, private, must-revalidate
|
287
334
|
X-Request-Id:
|
288
|
-
-
|
335
|
+
- 27dec649-4334-443f-9a9a-0dcab3d706c1
|
289
336
|
X-Runtime:
|
290
|
-
- '0.
|
337
|
+
- '0.033813'
|
291
338
|
Date:
|
292
|
-
- Thu,
|
339
|
+
- Thu, 19 Nov 2015 15:41:08 GMT
|
293
340
|
Connection:
|
294
341
|
- close
|
295
342
|
body:
|
296
343
|
encoding: UTF-8
|
297
|
-
string: '{"name":"
|
298
|
-
|
299
|
-
trail over any time","hint":"Keep going...","image":"http://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.150Z","updated_at":"2015-09-03T10:51:08.150Z","level":"gold","auto_issue":false,"status":"live","required_badges":[{"name":"You
|
300
|
-
Trim Trailed!","description":"You ran one lap of the trim trail","requirements":"Complete
|
301
|
-
one lap of the trim trail","hint":"Have to used the trim trail?","image":"http://gamification-api.dev/badge_images/you-trim-trailed/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.077Z","updated_at":"2015-09-03T10:51:08.077Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"you-trim-trailed"}],"points":75,"object":"badge","id":"marathon-man"}'
|
344
|
+
string: '{"name":"Create Badge","description":"This is a new badge","requirements":"You
|
345
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:40:52.393Z","updated_at":"2015-11-19T15:40:52.393Z","level":"silver","auto_issue":false,"status":"draft","required_badges":[],"points":50,"object":"badge","id":"create-badge"}'
|
302
346
|
http_version:
|
303
|
-
recorded_at: Thu,
|
347
|
+
recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
|
304
348
|
- request:
|
305
349
|
method: delete
|
306
|
-
uri:
|
350
|
+
uri: https://gamification-api.dev/v1/badges/required-badge
|
307
351
|
body:
|
308
352
|
encoding: US-ASCII
|
309
353
|
string: ''
|
310
354
|
headers:
|
311
355
|
User-Agent:
|
312
|
-
- Faraday v0.9.
|
356
|
+
- Faraday v0.9.2
|
313
357
|
Authorization:
|
314
358
|
- Token token="c9cde524238644fa93393159e5e9ad87"
|
315
359
|
Accept-Encoding:
|
@@ -321,6 +365,8 @@ http_interactions:
|
|
321
365
|
code: 200
|
322
366
|
message: OK
|
323
367
|
headers:
|
368
|
+
Strict-Transport-Security:
|
369
|
+
- max-age=31536000
|
324
370
|
X-Frame-Options:
|
325
371
|
- SAMEORIGIN
|
326
372
|
X-Xss-Protection:
|
@@ -330,22 +376,21 @@ http_interactions:
|
|
330
376
|
Content-Type:
|
331
377
|
- application/json; charset=utf-8
|
332
378
|
Etag:
|
333
|
-
- '"
|
379
|
+
- '"389dd2b408111b119674762feb3a9f22"'
|
334
380
|
Cache-Control:
|
335
381
|
- max-age=0, private, must-revalidate
|
336
382
|
X-Request-Id:
|
337
|
-
-
|
383
|
+
- 0b6ab9ed-ea1a-445b-9606-5c6ede7498a7
|
338
384
|
X-Runtime:
|
339
|
-
- '0.
|
385
|
+
- '0.039236'
|
340
386
|
Date:
|
341
|
-
- Thu,
|
387
|
+
- Thu, 19 Nov 2015 15:41:09 GMT
|
342
388
|
Connection:
|
343
389
|
- close
|
344
390
|
body:
|
345
391
|
encoding: UTF-8
|
346
|
-
string: '{"name":"
|
347
|
-
|
348
|
-
trail over any time","hint":"Keep going...","image":"http://gamification-api.dev/badge_images/marathon-man/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:51:08.150Z","updated_at":"2015-09-03T10:51:08.150Z","level":"gold","auto_issue":false,"status":"live","required_badges":[],"points":75,"object":"badge","id":"marathon-man"}'
|
392
|
+
string: '{"name":"Required Badge","description":"This is a new badge","requirements":"You
|
393
|
+
need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/required-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:00.844Z","updated_at":"2015-11-19T15:41:00.844Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"required-badge"}'
|
349
394
|
http_version:
|
350
|
-
recorded_at: Thu,
|
395
|
+
recorded_at: Thu, 19 Nov 2015 15:41:09 GMT
|
351
396
|
recorded_with: VCR 2.9.3
|