badgeapi 0.3.10 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rubocop.yml +147 -0
  4. data/README.md +44 -12
  5. data/Rakefile +24 -11
  6. data/badgeapi.gemspec +23 -22
  7. data/lib/badgeapi/badge.rb +24 -27
  8. data/lib/badgeapi/badgeapi_object.rb +160 -147
  9. data/lib/badgeapi/collection.rb +6 -9
  10. data/lib/badgeapi/errors/api_error.rb +3 -4
  11. data/lib/badgeapi/errors/badgeapi_error.rb +15 -15
  12. data/lib/badgeapi/errors/invalid_request_error.rb +3 -4
  13. data/lib/badgeapi/recipient.rb +13 -16
  14. data/lib/badgeapi/version.rb +1 -1
  15. data/lib/badgeapi.rb +13 -15
  16. data/test/badge/badge_test.rb +71 -150
  17. data/test/badgeapi_test.rb +4 -0
  18. data/test/collection/collection_test.rb +43 -77
  19. data/test/fixtures/badge_all.yml +113 -0
  20. data/test/fixtures/{bad_api_key.yml → badge_all_bad_user.yml} +14 -13
  21. data/test/fixtures/{all_badges_bad_user.yml → badge_all_badges_bad_user.yml} +16 -57
  22. data/test/fixtures/badge_all_expanded.yml +184 -0
  23. data/test/fixtures/badge_all_from_collection.yml +52 -0
  24. data/test/fixtures/badge_all_issued.yml +99 -0
  25. data/test/fixtures/{all_badges_limited.yml → badge_all_limited.yml} +10 -8
  26. data/test/fixtures/{create_badge.yml → badge_create.yml} +20 -16
  27. data/test/fixtures/{create_new_badge_failure.yml → badge_create_new.yml} +28 -22
  28. data/test/fixtures/badge_destroy.yml +147 -0
  29. data/test/fixtures/badge_destroy_error.yml +147 -0
  30. data/test/fixtures/badge_error.yml +54 -6
  31. data/test/fixtures/{issue_badge_to_bad_user.yml → badge_issue_to_bad_user.yml} +8 -6
  32. data/test/fixtures/badge_issue_to_user.yml +107 -0
  33. data/test/fixtures/{issue_badge_to_user_with_library_card.yml → badge_issue_to_user_with_library_card.yml} +21 -17
  34. data/test/fixtures/{one_badge.yml → badge_one.yml} +10 -8
  35. data/test/fixtures/{one_badge_expanded.yml → badge_one_expanded.yml} +11 -9
  36. data/test/fixtures/badge_requirements.yml +150 -105
  37. data/test/fixtures/badge_revoke_from_user.yml +107 -0
  38. data/test/fixtures/{update_badge_via_update.yml → badge_update_via_update.yml} +31 -25
  39. data/test/fixtures/{update_badge_via_update_slug_history.yml → badge_update_via_update_slug_history.yml} +41 -33
  40. data/test/fixtures/{all_collection.yml → collection_all.yml} +11 -9
  41. data/test/fixtures/collection_all_expanded.yml +123 -0
  42. data/test/fixtures/{all_collection_limit.yml → collection_all_limit.yml} +10 -8
  43. data/test/fixtures/{create_collection.yml → collection_create.yml} +20 -16
  44. data/test/fixtures/{create_new_collection_failure.yml → collection_create_new_failure.yml} +36 -28
  45. data/test/fixtures/{destroy_collection.yml → collection_destroy.yml} +36 -28
  46. data/test/fixtures/{destroy_collection_error.yml → collection_destroy_error.yml} +36 -28
  47. data/test/fixtures/collection_error.yml +108 -12
  48. data/test/fixtures/{one_collection.yml → collection_one.yml} +10 -8
  49. data/test/fixtures/collection_one_expanded.yml +106 -0
  50. data/test/fixtures/{update_collection.yml → collection_update.yml} +40 -32
  51. data/test/fixtures/{update_collection_via_update.yml → collection_update_via_update.yml} +30 -24
  52. data/test/fixtures/{bad_Recipietn_request.yml → recipient_bad_user_data.yml} +26 -22
  53. data/test/fixtures/recipient_with_badges.yml +20 -108
  54. data/test/fixtures/recipient_with_badges_unicard.yml +151 -8
  55. data/test/recipient/recipient_test.rb +11 -29
  56. metadata +69 -73
  57. data/test/fixtures/all_badges.yml +0 -121
  58. data/test/fixtures/all_badges_expanded.yml +0 -196
  59. data/test/fixtures/all_badges_from_collection.yml +0 -52
  60. data/test/fixtures/all_badges_issued.yml +0 -430
  61. data/test/fixtures/all_collection_expanded.yml +0 -131
  62. data/test/fixtures/bad_Recipient.yml +0 -183
  63. data/test/fixtures/destroy_badge.yml +0 -277
  64. data/test/fixtures/destroy_badge_error.yml +0 -231
  65. data/test/fixtures/issue_already_owned_badge.yml +0 -49
  66. data/test/fixtures/issue_badge_to_user.yml +0 -199
  67. data/test/fixtures/one_collection_expanded.yml +0 -104
  68. data/test/fixtures/revoke_badge_from_user.yml +0 -199
  69. data/test/fixtures/revoke_badge_not_issued.yml +0 -49
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://gamification-api.dev/v1/badges/1
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.1
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
- - '"0aa697870a80c49926a1006d73e8ef78"'
34
+ - '"bf7d978a396c4d28179b1b9dcb8bccd5"'
33
35
  Cache-Control:
34
36
  - max-age=0, private, must-revalidate
35
37
  X-Request-Id:
36
- - 65595aaf-ecf8-4550-8caa-a248a845cdd8
38
+ - a9ac26ca-cefa-43bd-ba83-00c3e5aa8e90
37
39
  X-Runtime:
38
- - '0.015072'
40
+ - '0.014991'
39
41
  Date:
40
- - Thu, 03 Sep 2015 10:55:57 GMT
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":"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","required_badges":[],"points":25,"object":"badge","id":"book-worm"}'
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, 03 Sep 2015 10:55:57 GMT
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: http://gamification-api.dev/v1/badges/1?expand=collection
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.1
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
- - '"c2fe44fa24cbf8fa4f769a1208d77def"'
34
+ - '"39ba12dc263e2f289462422462930c7f"'
33
35
  Cache-Control:
34
36
  - max-age=0, private, must-revalidate
35
37
  X-Request-Id:
36
- - 5bbed71c-3ff4-4925-a8cd-c35f793b9aaa
38
+ - ac4c65d3-572b-4aa9-8217-8ea7bbfcd914
37
39
  X-Runtime:
38
- - '0.015273'
40
+ - '0.017174'
39
41
  Date:
40
- - Thu, 03 Sep 2015 10:55:57 GMT
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":"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","required_badges":[],"points":25,"object":"badge","collection":{"id":"library","name":"Library","description":"Use
47
- your library and earn badges","created_at":"2015-09-03T10:51:07.747Z","updated_at":"2015-09-03T10:51:07.747Z"},"id":"book-worm"}'
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, 03 Sep 2015 10:55:57 GMT
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: http://gamification-api.dev/v1/badges/book-worm/require
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=mega-worm
57
+ string: required_badge%5Bid%5D=you-trim-trailed
9
58
  headers:
10
59
  User-Agent:
11
- - Faraday v0.9.1
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
- - 2cb2edeb-5c44-4ed8-87c5-29fd2199d576
87
+ - 52129633-1b5a-46ee-9ea8-2bdbcb8e32e3
37
88
  X-Runtime:
38
- - '0.013126'
89
+ - '0.009989'
39
90
  Date:
40
- - Tue, 21 Jul 2015 10:01:29 GMT
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":"Unrecognized Request:
46
- (POST /v1/badges/book-worm/require)","status":404}}'
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: Tue, 21 Jul 2015 10:01:29 GMT
99
+ recorded_at: Thu, 19 Nov 2015 15:31:06 GMT
49
100
  - request:
50
- method: get
51
- uri: http://gamification-api.dev/v1/badges/1
101
+ method: post
102
+ uri: https://gamification-api.dev/v1/badges
52
103
  body:
53
- encoding: US-ASCII
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.1
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: 200
67
- message: OK
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
- - '"7375a72c89785842b9c3663fea03002d"'
133
+ - '"832626c4208c709a5021b4d6073d56af"'
79
134
  Cache-Control:
80
135
  - max-age=0, private, must-revalidate
81
136
  X-Request-Id:
82
- - de89031b-bbc8-4325-8d6f-61497fe48b5a
137
+ - 87c73c71-1d44-47be-a217-2387726025f1
83
138
  X-Runtime:
84
- - '0.015381'
139
+ - '8.377910'
85
140
  Date:
86
- - Tue, 21 Jul 2015 10:01:54 GMT
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":"Book Worm","description":"You have loaned out over 25 books.
92
- 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"}'
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: Tue, 21 Jul 2015 10:01:54 GMT
149
+ recorded_at: Thu, 19 Nov 2015 15:41:00 GMT
95
150
  - request:
96
151
  method: post
97
- uri: http://gamification-api.dev/v1/badges/book-worm/requires
152
+ uri: https://gamification-api.dev/v1/badges
98
153
  body:
99
154
  encoding: UTF-8
100
- string: required_badge%5Bid%5D=mega-book-worm
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.1
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: 422
115
- message: Unprocessable Entity
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
- - no-cache
185
+ - max-age=0, private, must-revalidate
127
186
  X-Request-Id:
128
- - 4372fd68-cf6b-4ec4-9ed3-9ed820549b63
187
+ - 5ba2fea9-deab-47e6-bccd-42e4876ad0fd
129
188
  X-Runtime:
130
- - '0.022954'
189
+ - '7.800611'
131
190
  Date:
132
- - Tue, 21 Jul 2015 10:46:45 GMT
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: '{"error":{"type":"invalid_request_error","message":"The badge Book
138
- Worm cannot require Mega Book Worm as Mega Book Worm already requires Book
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: Tue, 21 Jul 2015 10:46:45 GMT
199
+ recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
142
200
  - request:
143
- method: get
144
- uri: http://gamification-api.dev/v1/badges/book-worm
201
+ method: post
202
+ uri: https://gamification-api.dev/v1/badges/create-badge/requires
145
203
  body:
146
- encoding: US-ASCII
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.1
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
- - '"351520548f54943b5795ee367e48a4ea"'
233
+ - '"d9fb2e750d6784649d62736ef151dc37"'
172
234
  Cache-Control:
173
235
  - max-age=0, private, must-revalidate
174
236
  X-Request-Id:
175
- - 2bf5a36f-e04d-4a01-ae9b-692f6fb51688
237
+ - 36f1bfe3-88a2-41d1-8a0d-3218bc9461eb
176
238
  X-Runtime:
177
- - '0.018645'
239
+ - '0.038161'
178
240
  Date:
179
- - Fri, 24 Jul 2015 15:34:24 GMT
241
+ - Thu, 19 Nov 2015 15:41:08 GMT
180
242
  Connection:
181
243
  - close
182
244
  body:
183
- encoding: ASCII-8BIT
184
- string: !binary |-
185
- eyJuYW1lIjoiQm9vayBXb3JtIiwiZGVzY3JpcHRpb24iOiJZb3UgaGF2ZSBs
186
- b2FuZWQgb3V0IG92ZXIgMjUgYm9va3MuIE5pY2UgZ29pbmchIiwicmVxdWly
187
- ZW1lbnRzIjoiTG9hbiBvdXQgMjUgYm9va3MiLCJoaW50IjoiWW91IG11c3Qg
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: Fri, 24 Jul 2015 15:34:24 GMT
251
+ recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
206
252
  - request:
207
- method: get
208
- uri: http://gamification-api.dev/v1/badges/marathon-man
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.1
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
- - '"b76260b4f37f78960fc02bad26465d56"'
283
+ - '"832626c4208c709a5021b4d6073d56af"'
236
284
  Cache-Control:
237
285
  - max-age=0, private, must-revalidate
238
286
  X-Request-Id:
239
- - 311b67f1-f184-4dd2-a3a4-69a01f12d703
287
+ - 3bd1bae7-556e-40b5-aebc-d6d7b0685cc6
240
288
  X-Runtime:
241
- - '0.031512'
289
+ - '0.023086'
242
290
  Date:
243
- - Thu, 03 Sep 2015 10:55:55 GMT
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":"Marathon Man","description":"You have run 10 laps of the trips
249
- trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
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, 03 Sep 2015 10:55:55 GMT
299
+ recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
253
300
  - request:
254
- method: post
255
- uri: http://gamification-api.dev/v1/badges/marathon-man/requires
301
+ method: delete
302
+ uri: https://gamification-api.dev/v1/badges/create-badge
256
303
  body:
257
- encoding: UTF-8
258
- string: required_badge%5Bid%5D=you-trim-trailed
304
+ encoding: US-ASCII
305
+ string: ''
259
306
  headers:
260
307
  User-Agent:
261
- - Faraday v0.9.1
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
- - '"5da6c4e1a6de18690aed1bd0d1847a38"'
331
+ - '"832626c4208c709a5021b4d6073d56af"'
285
332
  Cache-Control:
286
333
  - max-age=0, private, must-revalidate
287
334
  X-Request-Id:
288
- - 1d5d268f-ad6e-4ea7-ad91-48090a23782a
335
+ - 27dec649-4334-443f-9a9a-0dcab3d706c1
289
336
  X-Runtime:
290
- - '0.025049'
337
+ - '0.033813'
291
338
  Date:
292
- - Thu, 03 Sep 2015 10:55:55 GMT
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":"Marathon Man","description":"You have run 10 laps of the trips
298
- trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
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, 03 Sep 2015 10:55:56 GMT
347
+ recorded_at: Thu, 19 Nov 2015 15:41:08 GMT
304
348
  - request:
305
349
  method: delete
306
- uri: http://gamification-api.dev/v1/badges/marathon-man/requires?required_badge%5Bid%5D=you-trim-trailed
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.1
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
- - '"b76260b4f37f78960fc02bad26465d56"'
379
+ - '"389dd2b408111b119674762feb3a9f22"'
334
380
  Cache-Control:
335
381
  - max-age=0, private, must-revalidate
336
382
  X-Request-Id:
337
- - 61d8e380-87c6-496f-8753-97ef7496de76
383
+ - 0b6ab9ed-ea1a-445b-9606-5c6ede7498a7
338
384
  X-Runtime:
339
- - '0.020232'
385
+ - '0.039236'
340
386
  Date:
341
- - Thu, 03 Sep 2015 10:55:56 GMT
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":"Marathon Man","description":"You have run 10 laps of the trips
347
- trail that is 47 kilometers","requirements":"Complete 10 laps of the trim
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, 03 Sep 2015 10:55:56 GMT
395
+ recorded_at: Thu, 19 Nov 2015 15:41:09 GMT
351
396
  recorded_with: VCR 2.9.3