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: post
5
- uri: http://gamification-api.dev/v1/collections
5
+ uri: https://gamification-api.dev/v1/collections
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: collection%5Bdescription%5D=This+is+a+new+collection&collection%5Bname%5D=Create+Collection+for+update
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
  Content-Type:
@@ -22,6 +22,8 @@ http_interactions:
22
22
  code: 201
23
23
  message: Created
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,32 +33,32 @@ http_interactions:
31
33
  Content-Type:
32
34
  - application/json; charset=utf-8
33
35
  Etag:
34
- - '"c666289a55798731fd3cc77deb74f315"'
36
+ - '"58d49c25e806250dbde2763aa09eeb11"'
35
37
  Cache-Control:
36
38
  - max-age=0, private, must-revalidate
37
39
  X-Request-Id:
38
- - 978bd974-39db-45de-95fd-2ee8f036793e
40
+ - b7d53959-926e-4147-a1f8-4ec49835b582
39
41
  X-Runtime:
40
- - '0.026095'
42
+ - '0.021098'
41
43
  Date:
42
- - Thu, 03 Sep 2015 10:59:41 GMT
44
+ - Thu, 19 Nov 2015 14:34:15 GMT
43
45
  Connection:
44
46
  - close
45
47
  body:
46
48
  encoding: UTF-8
47
49
  string: '{"id":"create-collection-for-update","name":"Create Collection for
48
- update","description":"This is a new collection","created_at":"2015-09-03T10:59:41.624Z","updated_at":"2015-09-03T10:59:41.624Z","total_points_available":0,"badge_count":0,"object":"collection"}'
50
+ update","description":"This is a new collection","created_at":"2015-11-19T14:34:15.156Z","updated_at":"2015-11-19T14:34:15.156Z","total_points_available":0,"badge_count":0,"object":"collection"}'
49
51
  http_version:
50
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
52
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
51
53
  - request:
52
54
  method: patch
53
- uri: http://gamification-api.dev/v1/collections/create-collection-for-update
55
+ uri: https://gamification-api.dev/v1/collections/create-collection-for-update
54
56
  body:
55
57
  encoding: UTF-8
56
58
  string: collection%5Bdescription%5D=Updated+Collection&collection%5Bname%5D=Updated+Collection
57
59
  headers:
58
60
  User-Agent:
59
- - Faraday v0.9.1
61
+ - Faraday v0.9.2
60
62
  Authorization:
61
63
  - Token token="c9cde524238644fa93393159e5e9ad87"
62
64
  Content-Type:
@@ -70,6 +72,8 @@ http_interactions:
70
72
  code: 200
71
73
  message: OK
72
74
  headers:
75
+ Strict-Transport-Security:
76
+ - max-age=31536000
73
77
  X-Frame-Options:
74
78
  - SAMEORIGIN
75
79
  X-Xss-Protection:
@@ -79,32 +83,32 @@ http_interactions:
79
83
  Content-Type:
80
84
  - application/json; charset=utf-8
81
85
  Etag:
82
- - '"7494bb3e8456455d91f253f85cab43c3"'
86
+ - '"d1634d0a10e542e2303aaae3de11437a"'
83
87
  Cache-Control:
84
88
  - max-age=0, private, must-revalidate
85
89
  X-Request-Id:
86
- - e9728551-643e-4147-8ac5-4aa8c4bbe060
90
+ - 1d49138a-c168-4783-acf0-fdfc409f297d
87
91
  X-Runtime:
88
- - '0.025605'
92
+ - '0.018630'
89
93
  Date:
90
- - Thu, 03 Sep 2015 10:59:41 GMT
94
+ - Thu, 19 Nov 2015 14:34:15 GMT
91
95
  Connection:
92
96
  - close
93
97
  body:
94
98
  encoding: UTF-8
95
99
  string: '{"id":"updated-collection","name":"Updated Collection","description":"Updated
96
- Collection","created_at":"2015-09-03T10:59:41.624Z","updated_at":"2015-09-03T10:59:41.676Z","total_points_available":0,"badge_count":0,"object":"collection"}'
100
+ Collection","created_at":"2015-11-19T14:34:15.156Z","updated_at":"2015-11-19T14:34:15.231Z","total_points_available":0,"badge_count":0,"object":"collection"}'
97
101
  http_version:
98
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
102
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
99
103
  - request:
100
104
  method: get
101
- uri: http://gamification-api.dev/v1/collections/create-collection-for-update
105
+ uri: https://gamification-api.dev/v1/collections/create-collection-for-update
102
106
  body:
103
107
  encoding: US-ASCII
104
108
  string: ''
105
109
  headers:
106
110
  User-Agent:
107
- - Faraday v0.9.1
111
+ - Faraday v0.9.2
108
112
  Authorization:
109
113
  - Token token="c9cde524238644fa93393159e5e9ad87"
110
114
  Accept-Encoding:
@@ -116,6 +120,8 @@ http_interactions:
116
120
  code: 200
117
121
  message: OK
118
122
  headers:
123
+ Strict-Transport-Security:
124
+ - max-age=31536000
119
125
  X-Frame-Options:
120
126
  - SAMEORIGIN
121
127
  X-Xss-Protection:
@@ -125,32 +131,32 @@ http_interactions:
125
131
  Content-Type:
126
132
  - application/json; charset=utf-8
127
133
  Etag:
128
- - '"7494bb3e8456455d91f253f85cab43c3"'
134
+ - '"d1634d0a10e542e2303aaae3de11437a"'
129
135
  Cache-Control:
130
136
  - max-age=0, private, must-revalidate
131
137
  X-Request-Id:
132
- - 9b1ed3d4-efcf-4a83-b48b-ad4c38c3e2a3
138
+ - e128a631-74e7-40b8-91dd-888763523aa8
133
139
  X-Runtime:
134
- - '0.033049'
140
+ - '0.009746'
135
141
  Date:
136
- - Thu, 03 Sep 2015 10:59:41 GMT
142
+ - Thu, 19 Nov 2015 14:34:15 GMT
137
143
  Connection:
138
144
  - close
139
145
  body:
140
146
  encoding: UTF-8
141
147
  string: '{"id":"updated-collection","name":"Updated Collection","description":"Updated
142
- Collection","created_at":"2015-09-03T10:59:41.624Z","updated_at":"2015-09-03T10:59:41.676Z","total_points_available":0,"badge_count":0,"object":"collection"}'
148
+ Collection","created_at":"2015-11-19T14:34:15.156Z","updated_at":"2015-11-19T14:34:15.231Z","total_points_available":0,"badge_count":0,"object":"collection"}'
143
149
  http_version:
144
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
150
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
145
151
  - request:
146
152
  method: delete
147
- uri: http://gamification-api.dev/v1/collections/create-collection-for-update
153
+ uri: https://gamification-api.dev/v1/collections/create-collection-for-update
148
154
  body:
149
155
  encoding: US-ASCII
150
156
  string: ''
151
157
  headers:
152
158
  User-Agent:
153
- - Faraday v0.9.1
159
+ - Faraday v0.9.2
154
160
  Authorization:
155
161
  - Token token="c9cde524238644fa93393159e5e9ad87"
156
162
  Accept-Encoding:
@@ -162,6 +168,8 @@ http_interactions:
162
168
  code: 200
163
169
  message: OK
164
170
  headers:
171
+ Strict-Transport-Security:
172
+ - max-age=31536000
165
173
  X-Frame-Options:
166
174
  - SAMEORIGIN
167
175
  X-Xss-Protection:
@@ -171,21 +179,21 @@ http_interactions:
171
179
  Content-Type:
172
180
  - application/json; charset=utf-8
173
181
  Etag:
174
- - '"7494bb3e8456455d91f253f85cab43c3"'
182
+ - '"d1634d0a10e542e2303aaae3de11437a"'
175
183
  Cache-Control:
176
184
  - max-age=0, private, must-revalidate
177
185
  X-Request-Id:
178
- - 39aa1c48-f0ea-41b7-a2f5-b7624f4a92f0
186
+ - 8215b475-0d3d-4716-b5a8-35bf40fe9630
179
187
  X-Runtime:
180
- - '0.022458'
188
+ - '0.014892'
181
189
  Date:
182
- - Thu, 03 Sep 2015 10:59:41 GMT
190
+ - Thu, 19 Nov 2015 14:34:15 GMT
183
191
  Connection:
184
192
  - close
185
193
  body:
186
194
  encoding: UTF-8
187
195
  string: '{"id":"updated-collection","name":"Updated Collection","description":"Updated
188
- Collection","created_at":"2015-09-03T10:59:41.624Z","updated_at":"2015-09-03T10:59:41.676Z","total_points_available":0,"badge_count":0,"object":"collection"}'
196
+ Collection","created_at":"2015-11-19T14:34:15.156Z","updated_at":"2015-11-19T14:34:15.231Z","total_points_available":0,"badge_count":0,"object":"collection"}'
189
197
  http_version:
190
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
198
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
191
199
  recorded_with: VCR 2.9.3
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://gamification-api.dev/v1/collections
5
+ uri: https://gamification-api.dev/v1/collections
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: collection%5Bdescription%5D=This+is+a+new+collection&collection%5Bname%5D=Create+Collection+for+update
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
  Content-Type:
@@ -22,6 +22,8 @@ http_interactions:
22
22
  code: 201
23
23
  message: Created
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,32 +33,32 @@ http_interactions:
31
33
  Content-Type:
32
34
  - application/json; charset=utf-8
33
35
  Etag:
34
- - '"46e030fb97fab917228bda746fc557b1"'
36
+ - '"ff02420ed9fa940733250b92c75ad7b1"'
35
37
  Cache-Control:
36
38
  - max-age=0, private, must-revalidate
37
39
  X-Request-Id:
38
- - 0abbf4e8-63ff-4835-a216-c4fc9922d5a3
40
+ - 39cbd475-c6a5-4798-965e-e79b93e19fff
39
41
  X-Runtime:
40
- - '0.023212'
42
+ - '0.015545'
41
43
  Date:
42
- - Thu, 03 Sep 2015 10:59:41 GMT
44
+ - Thu, 19 Nov 2015 14:34:15 GMT
43
45
  Connection:
44
46
  - close
45
47
  body:
46
48
  encoding: UTF-8
47
49
  string: '{"id":"create-collection-for-update","name":"Create Collection for
48
- update","description":"This is a new collection","created_at":"2015-09-03T10:59:41.823Z","updated_at":"2015-09-03T10:59:41.823Z","total_points_available":0,"badge_count":0,"object":"collection"}'
50
+ update","description":"This is a new collection","created_at":"2015-11-19T14:34:15.443Z","updated_at":"2015-11-19T14:34:15.443Z","total_points_available":0,"badge_count":0,"object":"collection"}'
49
51
  http_version:
50
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
52
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
51
53
  - request:
52
54
  method: patch
53
- uri: http://gamification-api.dev/v1/collections/create-collection-for-update
55
+ uri: https://gamification-api.dev/v1/collections/create-collection-for-update
54
56
  body:
55
57
  encoding: UTF-8
56
58
  string: collection%5Bdescription%5D=Updated+Description&collection%5Bname%5D=Updated+Badge
57
59
  headers:
58
60
  User-Agent:
59
- - Faraday v0.9.1
61
+ - Faraday v0.9.2
60
62
  Authorization:
61
63
  - Token token="c9cde524238644fa93393159e5e9ad87"
62
64
  Content-Type:
@@ -70,6 +72,8 @@ http_interactions:
70
72
  code: 200
71
73
  message: OK
72
74
  headers:
75
+ Strict-Transport-Security:
76
+ - max-age=31536000
73
77
  X-Frame-Options:
74
78
  - SAMEORIGIN
75
79
  X-Xss-Protection:
@@ -79,32 +83,32 @@ http_interactions:
79
83
  Content-Type:
80
84
  - application/json; charset=utf-8
81
85
  Etag:
82
- - '"7ee6f28cc71adcdfc0ac35b28ab6a2b7"'
86
+ - '"c0e5ffaf19546d014efb4149340fb0df"'
83
87
  Cache-Control:
84
88
  - max-age=0, private, must-revalidate
85
89
  X-Request-Id:
86
- - bfb422eb-108e-4f9c-8cec-bb8816f8ad09
90
+ - e84a58ca-26cd-43b3-b00d-c1b753d0186a
87
91
  X-Runtime:
88
- - '0.023264'
92
+ - '0.018968'
89
93
  Date:
90
- - Thu, 03 Sep 2015 10:59:41 GMT
94
+ - Thu, 19 Nov 2015 14:34:15 GMT
91
95
  Connection:
92
96
  - close
93
97
  body:
94
98
  encoding: UTF-8
95
99
  string: '{"id":"updated-badge","name":"Updated Badge","description":"Updated
96
- Description","created_at":"2015-09-03T10:59:41.823Z","updated_at":"2015-09-03T10:59:41.866Z","total_points_available":0,"badge_count":0,"object":"collection"}'
100
+ Description","created_at":"2015-11-19T14:34:15.443Z","updated_at":"2015-11-19T14:34:15.512Z","total_points_available":0,"badge_count":0,"object":"collection"}'
97
101
  http_version:
98
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
102
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
99
103
  - request:
100
104
  method: delete
101
- uri: http://gamification-api.dev/v1/collections/create-collection-for-update
105
+ uri: https://gamification-api.dev/v1/collections/create-collection-for-update
102
106
  body:
103
107
  encoding: US-ASCII
104
108
  string: ''
105
109
  headers:
106
110
  User-Agent:
107
- - Faraday v0.9.1
111
+ - Faraday v0.9.2
108
112
  Authorization:
109
113
  - Token token="c9cde524238644fa93393159e5e9ad87"
110
114
  Accept-Encoding:
@@ -116,6 +120,8 @@ http_interactions:
116
120
  code: 200
117
121
  message: OK
118
122
  headers:
123
+ Strict-Transport-Security:
124
+ - max-age=31536000
119
125
  X-Frame-Options:
120
126
  - SAMEORIGIN
121
127
  X-Xss-Protection:
@@ -125,21 +131,21 @@ http_interactions:
125
131
  Content-Type:
126
132
  - application/json; charset=utf-8
127
133
  Etag:
128
- - '"7ee6f28cc71adcdfc0ac35b28ab6a2b7"'
134
+ - '"c0e5ffaf19546d014efb4149340fb0df"'
129
135
  Cache-Control:
130
136
  - max-age=0, private, must-revalidate
131
137
  X-Request-Id:
132
- - b651b40d-d6ea-4aa1-80a4-041016937317
138
+ - 4d1ed899-0d89-4a18-a1fa-b79fd7a65774
133
139
  X-Runtime:
134
- - '0.018966'
140
+ - '0.014745'
135
141
  Date:
136
- - Thu, 03 Sep 2015 10:59:41 GMT
142
+ - Thu, 19 Nov 2015 14:34:15 GMT
137
143
  Connection:
138
144
  - close
139
145
  body:
140
146
  encoding: UTF-8
141
147
  string: '{"id":"updated-badge","name":"Updated Badge","description":"Updated
142
- Description","created_at":"2015-09-03T10:59:41.823Z","updated_at":"2015-09-03T10:59:41.866Z","total_points_available":0,"badge_count":0,"object":"collection"}'
148
+ Description","created_at":"2015-11-19T14:34:15.443Z","updated_at":"2015-11-19T14:34:15.512Z","total_points_available":0,"badge_count":0,"object":"collection"}'
143
149
  http_version:
144
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
150
+ recorded_at: Thu, 19 Nov 2015 14:34:15 GMT
145
151
  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/recipients
5
+ uri: https://gamification-api.dev/v1/recipients?user=dfsgsdgg
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:
@@ -17,9 +17,11 @@ http_interactions:
17
17
  - "*/*"
18
18
  response:
19
19
  status:
20
- code: 422
21
- message: Unprocessable Entity
20
+ code: 404
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,29 +33,29 @@ http_interactions:
31
33
  Cache-Control:
32
34
  - no-cache
33
35
  X-Request-Id:
34
- - 2c089825-3419-4c89-81f7-9957a9c13faf
36
+ - ac238241-432d-4937-b43f-dd3f2fc8d675
35
37
  X-Runtime:
36
- - '0.011890'
38
+ - '0.021493'
37
39
  Date:
38
- - Fri, 17 Jul 2015 15:20:17 GMT
40
+ - Thu, 19 Nov 2015 14:15:35 GMT
39
41
  Connection:
40
42
  - close
41
43
  body:
42
44
  encoding: UTF-8
43
- string: '{"error":{"type":"invalid_request_error","message":"No user specified.
44
- Please specify user as a param using either university email or university
45
- card. e.g user=user@lancaster.ac.uk","status":422}}'
45
+ string: '{"error":{"type":"invalid_request_error","message":"Unable to find
46
+ user with specified data dfsgsdgg. Recipient data must be a university email
47
+ address, university card number or username.","status":404}}'
46
48
  http_version:
47
- recorded_at: Fri, 17 Jul 2015 15:20:17 GMT
49
+ recorded_at: Thu, 19 Nov 2015 14:15:35 GMT
48
50
  - request:
49
51
  method: get
50
- uri: http://gamification-api.dev/v1/recipients
52
+ uri: https://gamification-api.dev/v1/recipients?user=dfsgsdgg
51
53
  body:
52
54
  encoding: US-ASCII
53
55
  string: ''
54
56
  headers:
55
57
  User-Agent:
56
- - Faraday v0.9.1
58
+ - Faraday v0.9.2
57
59
  Authorization:
58
60
  - Token token="c9cde524238644fa93393159e5e9ad87"
59
61
  Accept-Encoding:
@@ -62,9 +64,11 @@ http_interactions:
62
64
  - "*/*"
63
65
  response:
64
66
  status:
65
- code: 422
66
- message: Unprocessable Entity
67
+ code: 404
68
+ message: Not Found
67
69
  headers:
70
+ Strict-Transport-Security:
71
+ - max-age=31536000
68
72
  X-Frame-Options:
69
73
  - SAMEORIGIN
70
74
  X-Xss-Protection:
@@ -76,18 +80,18 @@ http_interactions:
76
80
  Cache-Control:
77
81
  - no-cache
78
82
  X-Request-Id:
79
- - f5ff496b-d4d6-401b-8300-6f71893789cb
83
+ - 1abf0455-e03e-4652-9eea-818ff84aed36
80
84
  X-Runtime:
81
- - '0.011752'
85
+ - '0.015815'
82
86
  Date:
83
- - Fri, 17 Jul 2015 15:20:17 GMT
87
+ - Thu, 19 Nov 2015 14:15:35 GMT
84
88
  Connection:
85
89
  - close
86
90
  body:
87
91
  encoding: UTF-8
88
- string: '{"error":{"type":"invalid_request_error","message":"No user specified.
89
- Please specify user as a param using either university email or university
90
- card. e.g user=user@lancaster.ac.uk","status":422}}'
92
+ string: '{"error":{"type":"invalid_request_error","message":"Unable to find
93
+ user with specified data dfsgsdgg. Recipient data must be a university email
94
+ address, university card number or username.","status":404}}'
91
95
  http_version:
92
- recorded_at: Fri, 17 Jul 2015 15:20:17 GMT
96
+ recorded_at: Thu, 19 Nov 2015 14:15:35 GMT
93
97
  recorded_with: VCR 2.9.3
@@ -2,103 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://gamification-api.dev/v1/recipients
5
+ uri: https://gamification-api.dev/v1/recipients?recipient=j.stennett@lancaster.ac.uk
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
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: 422
21
- message: Unprocessable Entity
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
- Cache-Control:
32
- - no-cache
33
- X-Request-Id:
34
- - 2c447f68-f9f4-4065-b334-eec868997103
35
- X-Runtime:
36
- - '0.008719'
37
- Date:
38
- - Fri, 17 Jul 2015 15:18:44 GMT
39
- Connection:
40
- - close
41
- body:
42
- encoding: UTF-8
43
- string: '{"error":{"type":"invalid_request_error","message":"No user specified.
44
- Please specify user as a param using either university email or university
45
- card. e.g user=user@lancaster.ac.uk","status":422}}'
46
- http_version:
47
- recorded_at: Fri, 17 Jul 2015 15:18:44 GMT
48
- - request:
49
- method: get
50
- uri: http://gamification-api.dev/v1/recipients
51
- body:
52
- encoding: US-ASCII
53
- string: ''
54
- headers:
55
- User-Agent:
56
- - Faraday v0.9.1
57
- Authorization:
58
- - Token token="c9cde524238644fa93393159e5e9ad87"
59
- Accept-Encoding:
60
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
61
- Accept:
62
- - "*/*"
63
- response:
64
- status:
65
- code: 422
66
- message: Unprocessable Entity
67
- headers:
68
- X-Frame-Options:
69
- - SAMEORIGIN
70
- X-Xss-Protection:
71
- - 1; mode=block
72
- X-Content-Type-Options:
73
- - nosniff
74
- Content-Type:
75
- - application/json; charset=utf-8
76
- Cache-Control:
77
- - no-cache
78
- X-Request-Id:
79
- - 5fb4a26b-1995-4a93-a3d4-f02c145361ed
80
- X-Runtime:
81
- - '0.007406'
82
- Date:
83
- - Fri, 17 Jul 2015 15:18:44 GMT
84
- Connection:
85
- - close
86
- body:
87
- encoding: UTF-8
88
- string: '{"error":{"type":"invalid_request_error","message":"No user specified.
89
- Please specify user as a param using either university email or university
90
- card. e.g user=user@lancaster.ac.uk","status":422}}'
91
- http_version:
92
- recorded_at: Fri, 17 Jul 2015 15:18:44 GMT
93
- - request:
94
- method: get
95
- uri: http://gamification-api.dev/v1/recipients?user=t.skarbek-wazynski@lancaster.ac.uk
96
- body:
97
- encoding: US-ASCII
98
- string: ''
99
- headers:
100
- User-Agent:
101
- - Faraday v0.9.1
11
+ - Faraday v0.9.2
102
12
  Authorization:
103
13
  - Token token="c9cde524238644fa93393159e5e9ad87"
104
14
  Accept-Encoding:
@@ -110,6 +20,8 @@ http_interactions:
110
20
  code: 200
111
21
  message: OK
112
22
  headers:
23
+ Strict-Transport-Security:
24
+ - max-age=31536000
113
25
  X-Frame-Options:
114
26
  - SAMEORIGIN
115
27
  X-Xss-Protection:
@@ -119,33 +31,31 @@ http_interactions:
119
31
  Content-Type:
120
32
  - application/json; charset=utf-8
121
33
  Etag:
122
- - '"acde49a57ebc9ba795f6d09daff4d02a"'
34
+ - '"142264d94121989e7f083bdc1e6d7bda"'
123
35
  Cache-Control:
124
36
  - max-age=0, private, must-revalidate
125
37
  X-Request-Id:
126
- - e3e548f6-1f53-47e2-9cee-9838cf5ee4ce
38
+ - 1fa1e9c8-a8e3-4429-aa1e-78892143981b
127
39
  X-Runtime:
128
- - '0.023360'
40
+ - '0.072625'
129
41
  Date:
130
- - Tue, 21 Jul 2015 08:25:51 GMT
42
+ - Thu, 19 Nov 2015 14:13:57 GMT
131
43
  Connection:
132
44
  - close
133
45
  body:
134
46
  encoding: UTF-8
135
- string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"badges":[{"name":"Book
136
- Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
137
- out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/uploads/badge/image/1/seed.png","collection_id":1,"created_at":"2015-07-16T09:21:22.448Z","updated_at":"2015-07-16T09:21:22.448Z","slug":"book-worm","level":"bronze","image_greyscale":"http://gamification-api.dev/uploads/badge/image/1/grey_seed.png","points":25}]}'
47
+ string: '{"total_score":0,"badges_total":0,"bronze_count":0,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[]}'
138
48
  http_version:
139
- recorded_at: Tue, 21 Jul 2015 08:25:51 GMT
49
+ recorded_at: Thu, 19 Nov 2015 14:13:57 GMT
140
50
  - request:
141
51
  method: get
142
- uri: http://gamification-api.dev/v1/recipients?recipient=t.skarbek-wazynski@lancaster.ac.uk
52
+ uri: https://gamification-api.dev/v1/recipients?recipient=t.skarbek-wazynski@lancaster.ac.uk
143
53
  body:
144
54
  encoding: US-ASCII
145
55
  string: ''
146
56
  headers:
147
57
  User-Agent:
148
- - Faraday v0.9.1
58
+ - Faraday v0.9.2
149
59
  Authorization:
150
60
  - Token token="c9cde524238644fa93393159e5e9ad87"
151
61
  Accept-Encoding:
@@ -157,6 +67,8 @@ http_interactions:
157
67
  code: 200
158
68
  message: OK
159
69
  headers:
70
+ Strict-Transport-Security:
71
+ - max-age=31536000
160
72
  X-Frame-Options:
161
73
  - SAMEORIGIN
162
74
  X-Xss-Protection:
@@ -166,22 +78,22 @@ http_interactions:
166
78
  Content-Type:
167
79
  - application/json; charset=utf-8
168
80
  Etag:
169
- - '"b580cf4171303fd650475e570ec9458a"'
81
+ - '"365681d5132a5e92b7946178e30b2356"'
170
82
  Cache-Control:
171
83
  - max-age=0, private, must-revalidate
172
84
  X-Request-Id:
173
- - b460f226-7fbf-42bd-9ef2-0bef98ad2521
85
+ - 38b6bfe2-6e5f-405e-9c1d-60235765a88c
174
86
  X-Runtime:
175
- - '0.026877'
87
+ - '0.025262'
176
88
  Date:
177
- - Thu, 03 Sep 2015 10:56:09 GMT
89
+ - Thu, 19 Nov 2015 14:15:35 GMT
178
90
  Connection:
179
91
  - close
180
92
  body:
181
93
  encoding: UTF-8
182
94
  string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
183
95
  Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
184
- 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"}]}'
96
+ 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"}]}'
185
97
  http_version:
186
- recorded_at: Thu, 03 Sep 2015 10:56:09 GMT
98
+ recorded_at: Thu, 19 Nov 2015 14:15:35 GMT
187
99
  recorded_with: VCR 2.9.3