badgeapi 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +15 -0
- data/badgeapi.gemspec +33 -0
- data/lib/badgeapi/badge.rb +29 -0
- data/lib/badgeapi/badgeapi_object.rb +149 -0
- data/lib/badgeapi/collection.rb +10 -0
- data/lib/badgeapi/errors/api_error.rb +5 -0
- data/lib/badgeapi/errors/badgeapi_error.rb +18 -0
- data/lib/badgeapi/errors/invalid_request_error.rb +5 -0
- data/lib/badgeapi/recipient.rb +18 -0
- data/lib/badgeapi/version.rb +3 -0
- data/lib/badgeapi.rb +36 -0
- data/test/badge/badge_test.rb +469 -0
- data/test/badgeapi_test.rb +20 -0
- data/test/collection/collection_test.rb +275 -0
- data/test/fixtures/all_badges.yml +121 -0
- data/test/fixtures/all_badges_bad_user.yml +138 -0
- data/test/fixtures/all_badges_expanded.yml +196 -0
- data/test/fixtures/all_badges_from_collection.yml +52 -0
- data/test/fixtures/all_badges_issued.yml +430 -0
- data/test/fixtures/all_badges_limited.yml +49 -0
- data/test/fixtures/all_collection.yml +50 -0
- data/test/fixtures/all_collection_expanded.yml +131 -0
- data/test/fixtures/all_collection_limit.yml +49 -0
- data/test/fixtures/bad_Recipient.yml +183 -0
- data/test/fixtures/bad_Recipietn_request.yml +93 -0
- data/test/fixtures/bad_api_key.yml +49 -0
- data/test/fixtures/badge_error.yml +47 -0
- data/test/fixtures/badge_requirements.yml +351 -0
- data/test/fixtures/collection_error.yml +91 -0
- data/test/fixtures/create_badge.yml +97 -0
- data/test/fixtures/create_collection.yml +97 -0
- data/test/fixtures/create_new_badge_failure.yml +143 -0
- data/test/fixtures/create_new_collection_failure.yml +189 -0
- data/test/fixtures/destroy_badge.yml +277 -0
- data/test/fixtures/destroy_badge_error.yml +231 -0
- data/test/fixtures/destroy_collection.yml +185 -0
- data/test/fixtures/destroy_collection_error.yml +185 -0
- data/test/fixtures/issue_already_owned_badge.yml +49 -0
- data/test/fixtures/issue_badge_to_bad_user.yml +50 -0
- data/test/fixtures/issue_badge_to_user.yml +199 -0
- data/test/fixtures/issue_badge_to_user_with_library_card.yml +103 -0
- data/test/fixtures/one_badge.yml +49 -0
- data/test/fixtures/one_badge_expanded.yml +50 -0
- data/test/fixtures/one_collection.yml +49 -0
- data/test/fixtures/one_collection_expanded.yml +104 -0
- data/test/fixtures/recipient_with_badges.yml +187 -0
- data/test/fixtures/recipient_with_badges_unicard.yml +50 -0
- data/test/fixtures/revoke_badge_from_user.yml +199 -0
- data/test/fixtures/revoke_badge_not_issued.yml +49 -0
- data/test/fixtures/update_badge_via_update.yml +145 -0
- data/test/fixtures/update_badge_via_update_slug_history.yml +191 -0
- data/test/fixtures/update_collection.yml +191 -0
- data/test/fixtures/update_collection_via_update.yml +145 -0
- data/test/recipient/recipient_test.rb +108 -0
- data/test/test_helper.rb +11 -0
- metadata +274 -0
@@ -0,0 +1,143 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://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+Test+Destroy&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Authorization:
|
13
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
|
+
Content-Type:
|
15
|
+
- application/x-www-form-urlencoded
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
X-Frame-Options:
|
26
|
+
- SAMEORIGIN
|
27
|
+
X-Xss-Protection:
|
28
|
+
- 1; mode=block
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- '"543350fcaeeb07c27708621f9c00008f"'
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=0, private, must-revalidate
|
37
|
+
X-Request-Id:
|
38
|
+
- 8a7e4761-c728-43ac-8e5d-f5650499daf7
|
39
|
+
X-Runtime:
|
40
|
+
- '0.079480'
|
41
|
+
Date:
|
42
|
+
- Thu, 03 Sep 2015 10:55:56 GMT
|
43
|
+
Connection:
|
44
|
+
- close
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"name":"Create Badge Test Destroy","description":"This is a new badge","requirements":"You
|
48
|
+
need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-test-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:56.287Z","updated_at":"2015-09-03T10:55:56.287Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-test-destroy"}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
|
51
|
+
- request:
|
52
|
+
method: post
|
53
|
+
uri: http://gamification-api.dev/v1/badges
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
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+Test+Destroy&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
|
57
|
+
headers:
|
58
|
+
User-Agent:
|
59
|
+
- Faraday v0.9.1
|
60
|
+
Authorization:
|
61
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
62
|
+
Content-Type:
|
63
|
+
- application/x-www-form-urlencoded
|
64
|
+
Accept-Encoding:
|
65
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
66
|
+
Accept:
|
67
|
+
- "*/*"
|
68
|
+
response:
|
69
|
+
status:
|
70
|
+
code: 422
|
71
|
+
message: Unprocessable Entity
|
72
|
+
headers:
|
73
|
+
X-Frame-Options:
|
74
|
+
- SAMEORIGIN
|
75
|
+
X-Xss-Protection:
|
76
|
+
- 1; mode=block
|
77
|
+
X-Content-Type-Options:
|
78
|
+
- nosniff
|
79
|
+
Content-Type:
|
80
|
+
- application/json; charset=utf-8
|
81
|
+
Cache-Control:
|
82
|
+
- no-cache
|
83
|
+
X-Request-Id:
|
84
|
+
- b92600d5-96ae-42cd-808a-d5896440db4e
|
85
|
+
X-Runtime:
|
86
|
+
- '0.021309'
|
87
|
+
Date:
|
88
|
+
- Thu, 03 Sep 2015 10:55:56 GMT
|
89
|
+
Connection:
|
90
|
+
- close
|
91
|
+
body:
|
92
|
+
encoding: UTF-8
|
93
|
+
string: '{"error":{"type":"invalid_request_error","message":{"name":["has already
|
94
|
+
been taken"]},"status":422}}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
|
97
|
+
- request:
|
98
|
+
method: delete
|
99
|
+
uri: http://gamification-api.dev/v1/badges/create-badge-test-destroy
|
100
|
+
body:
|
101
|
+
encoding: US-ASCII
|
102
|
+
string: ''
|
103
|
+
headers:
|
104
|
+
User-Agent:
|
105
|
+
- Faraday v0.9.1
|
106
|
+
Authorization:
|
107
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
108
|
+
Accept-Encoding:
|
109
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
110
|
+
Accept:
|
111
|
+
- "*/*"
|
112
|
+
response:
|
113
|
+
status:
|
114
|
+
code: 200
|
115
|
+
message: OK
|
116
|
+
headers:
|
117
|
+
X-Frame-Options:
|
118
|
+
- SAMEORIGIN
|
119
|
+
X-Xss-Protection:
|
120
|
+
- 1; mode=block
|
121
|
+
X-Content-Type-Options:
|
122
|
+
- nosniff
|
123
|
+
Content-Type:
|
124
|
+
- application/json; charset=utf-8
|
125
|
+
Etag:
|
126
|
+
- '"543350fcaeeb07c27708621f9c00008f"'
|
127
|
+
Cache-Control:
|
128
|
+
- max-age=0, private, must-revalidate
|
129
|
+
X-Request-Id:
|
130
|
+
- 86eb7d04-dfd9-4646-b4f8-901f2e38142b
|
131
|
+
X-Runtime:
|
132
|
+
- '0.025862'
|
133
|
+
Date:
|
134
|
+
- Thu, 03 Sep 2015 10:55:56 GMT
|
135
|
+
Connection:
|
136
|
+
- close
|
137
|
+
body:
|
138
|
+
encoding: UTF-8
|
139
|
+
string: '{"name":"Create Badge Test Destroy","description":"This is a new badge","requirements":"You
|
140
|
+
need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-test-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:56.287Z","updated_at":"2015-09-03T10:55:56.287Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-test-destroy"}'
|
141
|
+
http_version:
|
142
|
+
recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
|
143
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,189 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://gamification-api.dev/v1/collections
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: collection%5Bdescription%5D=This+is+a+new+badge&collection%5Bname%5D=Create+Collection+Test+Destroy
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Authorization:
|
13
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
|
+
Content-Type:
|
15
|
+
- application/x-www-form-urlencoded
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
X-Frame-Options:
|
26
|
+
- SAMEORIGIN
|
27
|
+
X-Xss-Protection:
|
28
|
+
- 1; mode=block
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- '"28ae761fc9a1f5c37c18d20b73ed3214"'
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=0, private, must-revalidate
|
37
|
+
X-Request-Id:
|
38
|
+
- d4f5e1a6-9f3c-4ff6-94c9-5f41865e3340
|
39
|
+
X-Runtime:
|
40
|
+
- '0.024407'
|
41
|
+
Date:
|
42
|
+
- Thu, 03 Sep 2015 10:59:41 GMT
|
43
|
+
Connection:
|
44
|
+
- close
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"id":"create-collection-test-destroy","name":"Create Collection Test
|
48
|
+
Destroy","description":"This is a new badge","created_at":"2015-09-03T10:59:41.292Z","updated_at":"2015-09-03T10:59:41.292Z","total_points_available":0,"badge_count":0,"object":"collection"}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
51
|
+
- request:
|
52
|
+
method: post
|
53
|
+
uri: http://gamification-api.dev/v1/collections
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: collection%5Bdescription%5D=This+is+a+new+badge&collection%5Bname%5D=Create+Collection+Test+Destroy
|
57
|
+
headers:
|
58
|
+
User-Agent:
|
59
|
+
- Faraday v0.9.1
|
60
|
+
Authorization:
|
61
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
62
|
+
Content-Type:
|
63
|
+
- application/x-www-form-urlencoded
|
64
|
+
Accept-Encoding:
|
65
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
66
|
+
Accept:
|
67
|
+
- "*/*"
|
68
|
+
response:
|
69
|
+
status:
|
70
|
+
code: 422
|
71
|
+
message: Unprocessable Entity
|
72
|
+
headers:
|
73
|
+
X-Frame-Options:
|
74
|
+
- SAMEORIGIN
|
75
|
+
X-Xss-Protection:
|
76
|
+
- 1; mode=block
|
77
|
+
X-Content-Type-Options:
|
78
|
+
- nosniff
|
79
|
+
Content-Type:
|
80
|
+
- application/json; charset=utf-8
|
81
|
+
Cache-Control:
|
82
|
+
- no-cache
|
83
|
+
X-Request-Id:
|
84
|
+
- 254deecb-dd3e-4ef7-9079-4fe90ffb6e19
|
85
|
+
X-Runtime:
|
86
|
+
- '0.014566'
|
87
|
+
Date:
|
88
|
+
- Thu, 03 Sep 2015 10:59:41 GMT
|
89
|
+
Connection:
|
90
|
+
- close
|
91
|
+
body:
|
92
|
+
encoding: UTF-8
|
93
|
+
string: '{"error":{"type":"invalid_request_error","message":{"name":["has already
|
94
|
+
been taken"]},"status":422}}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
97
|
+
- request:
|
98
|
+
method: post
|
99
|
+
uri: http://gamification-api.dev/v1/collections
|
100
|
+
body:
|
101
|
+
encoding: UTF-8
|
102
|
+
string: collection%5Bdescription%5D=This+is+a+new+badge&collection%5Bname%5D=Create+Collection+Test+Destroy
|
103
|
+
headers:
|
104
|
+
User-Agent:
|
105
|
+
- Faraday v0.9.1
|
106
|
+
Authorization:
|
107
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
108
|
+
Content-Type:
|
109
|
+
- application/x-www-form-urlencoded
|
110
|
+
Accept-Encoding:
|
111
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
112
|
+
Accept:
|
113
|
+
- "*/*"
|
114
|
+
response:
|
115
|
+
status:
|
116
|
+
code: 422
|
117
|
+
message: Unprocessable Entity
|
118
|
+
headers:
|
119
|
+
X-Frame-Options:
|
120
|
+
- SAMEORIGIN
|
121
|
+
X-Xss-Protection:
|
122
|
+
- 1; mode=block
|
123
|
+
X-Content-Type-Options:
|
124
|
+
- nosniff
|
125
|
+
Content-Type:
|
126
|
+
- application/json; charset=utf-8
|
127
|
+
Cache-Control:
|
128
|
+
- no-cache
|
129
|
+
X-Request-Id:
|
130
|
+
- 6a1c28d1-e3db-4c3d-82dc-22cb27802b95
|
131
|
+
X-Runtime:
|
132
|
+
- '0.012178'
|
133
|
+
Date:
|
134
|
+
- Thu, 03 Sep 2015 10:59:41 GMT
|
135
|
+
Connection:
|
136
|
+
- close
|
137
|
+
body:
|
138
|
+
encoding: UTF-8
|
139
|
+
string: '{"error":{"type":"invalid_request_error","message":{"name":["has already
|
140
|
+
been taken"]},"status":422}}'
|
141
|
+
http_version:
|
142
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
143
|
+
- request:
|
144
|
+
method: delete
|
145
|
+
uri: http://gamification-api.dev/v1/collections/create-collection-test-destroy
|
146
|
+
body:
|
147
|
+
encoding: US-ASCII
|
148
|
+
string: ''
|
149
|
+
headers:
|
150
|
+
User-Agent:
|
151
|
+
- Faraday v0.9.1
|
152
|
+
Authorization:
|
153
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
154
|
+
Accept-Encoding:
|
155
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
156
|
+
Accept:
|
157
|
+
- "*/*"
|
158
|
+
response:
|
159
|
+
status:
|
160
|
+
code: 200
|
161
|
+
message: OK
|
162
|
+
headers:
|
163
|
+
X-Frame-Options:
|
164
|
+
- SAMEORIGIN
|
165
|
+
X-Xss-Protection:
|
166
|
+
- 1; mode=block
|
167
|
+
X-Content-Type-Options:
|
168
|
+
- nosniff
|
169
|
+
Content-Type:
|
170
|
+
- application/json; charset=utf-8
|
171
|
+
Etag:
|
172
|
+
- '"28ae761fc9a1f5c37c18d20b73ed3214"'
|
173
|
+
Cache-Control:
|
174
|
+
- max-age=0, private, must-revalidate
|
175
|
+
X-Request-Id:
|
176
|
+
- b428e981-3b97-4cdf-9a97-4fc518f5fe0a
|
177
|
+
X-Runtime:
|
178
|
+
- '0.016730'
|
179
|
+
Date:
|
180
|
+
- Thu, 03 Sep 2015 10:59:41 GMT
|
181
|
+
Connection:
|
182
|
+
- close
|
183
|
+
body:
|
184
|
+
encoding: UTF-8
|
185
|
+
string: '{"id":"create-collection-test-destroy","name":"Create Collection Test
|
186
|
+
Destroy","description":"This is a new badge","created_at":"2015-09-03T10:59:41.292Z","updated_at":"2015-09-03T10:59:41.292Z","total_points_available":0,"badge_count":0,"object":"collection"}'
|
187
|
+
http_version:
|
188
|
+
recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
|
189
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,277 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Authorization:
|
13
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
X-Frame-Options:
|
24
|
+
- SAMEORIGIN
|
25
|
+
X-Xss-Protection:
|
26
|
+
- 1; mode=block
|
27
|
+
X-Content-Type-Options:
|
28
|
+
- nosniff
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Etag:
|
32
|
+
- '"5c6438cacbae5b4e79dcbf9cb245feca"'
|
33
|
+
Cache-Control:
|
34
|
+
- max-age=0, private, must-revalidate
|
35
|
+
X-Request-Id:
|
36
|
+
- 2cb7df27-5d8e-4d7a-9e37-4d2ac2c8cad1
|
37
|
+
X-Runtime:
|
38
|
+
- '0.028375'
|
39
|
+
Date:
|
40
|
+
- Wed, 26 Aug 2015 13:33:30 GMT
|
41
|
+
Connection:
|
42
|
+
- close
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
46
|
+
need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-08-26T13:33:29.985Z","updated_at":"2015-08-26T13:33:30.103Z","level":"bronze","auto_issue":false,"status":"deleted","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Wed, 26 Aug 2015 13:33:30 GMT
|
49
|
+
- request:
|
50
|
+
method: delete
|
51
|
+
uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy-test
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ''
|
55
|
+
headers:
|
56
|
+
User-Agent:
|
57
|
+
- Faraday v0.9.1
|
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: 200
|
67
|
+
message: OK
|
68
|
+
headers:
|
69
|
+
X-Frame-Options:
|
70
|
+
- SAMEORIGIN
|
71
|
+
X-Xss-Protection:
|
72
|
+
- 1; mode=block
|
73
|
+
X-Content-Type-Options:
|
74
|
+
- nosniff
|
75
|
+
Content-Type:
|
76
|
+
- application/json; charset=utf-8
|
77
|
+
Etag:
|
78
|
+
- '"1fcd9ea83424440c49e580463e934382"'
|
79
|
+
Cache-Control:
|
80
|
+
- max-age=0, private, must-revalidate
|
81
|
+
X-Request-Id:
|
82
|
+
- 7f0b0e06-585f-4656-b53e-0ec9d8e7dd2c
|
83
|
+
X-Runtime:
|
84
|
+
- '0.034984'
|
85
|
+
Date:
|
86
|
+
- Thu, 27 Aug 2015 08:26:21 GMT
|
87
|
+
Connection:
|
88
|
+
- close
|
89
|
+
body:
|
90
|
+
encoding: UTF-8
|
91
|
+
string: '{"name":"Create Badge for Destroy Test","description":"This is a new
|
92
|
+
badge","requirements":"You need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy-test/badge.png","collection_id":"library","created_at":"2015-08-27T08:26:21.600Z","updated_at":"2015-08-27T08:26:21.600Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy-test"}'
|
93
|
+
http_version:
|
94
|
+
recorded_at: Thu, 27 Aug 2015 08:26:21 GMT
|
95
|
+
- request:
|
96
|
+
method: get
|
97
|
+
uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy-test
|
98
|
+
body:
|
99
|
+
encoding: US-ASCII
|
100
|
+
string: ''
|
101
|
+
headers:
|
102
|
+
User-Agent:
|
103
|
+
- Faraday v0.9.1
|
104
|
+
Authorization:
|
105
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
106
|
+
Accept-Encoding:
|
107
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
108
|
+
Accept:
|
109
|
+
- "*/*"
|
110
|
+
response:
|
111
|
+
status:
|
112
|
+
code: 404
|
113
|
+
message: Not Found
|
114
|
+
headers:
|
115
|
+
X-Frame-Options:
|
116
|
+
- SAMEORIGIN
|
117
|
+
X-Xss-Protection:
|
118
|
+
- 1; mode=block
|
119
|
+
X-Content-Type-Options:
|
120
|
+
- nosniff
|
121
|
+
Content-Type:
|
122
|
+
- application/json; charset=utf-8
|
123
|
+
Cache-Control:
|
124
|
+
- no-cache
|
125
|
+
X-Request-Id:
|
126
|
+
- 02154aab-00a9-42b4-83a8-b9c99c32a3a7
|
127
|
+
X-Runtime:
|
128
|
+
- '0.014950'
|
129
|
+
Date:
|
130
|
+
- Thu, 27 Aug 2015 08:26:21 GMT
|
131
|
+
Connection:
|
132
|
+
- close
|
133
|
+
body:
|
134
|
+
encoding: UTF-8
|
135
|
+
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
136
|
+
with id: create-badge-for-destroy-test","status":404}}'
|
137
|
+
http_version:
|
138
|
+
recorded_at: Thu, 27 Aug 2015 08:26:21 GMT
|
139
|
+
- request:
|
140
|
+
method: post
|
141
|
+
uri: http://gamification-api.dev/v1/badges
|
142
|
+
body:
|
143
|
+
encoding: UTF-8
|
144
|
+
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
|
145
|
+
headers:
|
146
|
+
User-Agent:
|
147
|
+
- Faraday v0.9.1
|
148
|
+
Authorization:
|
149
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
150
|
+
Content-Type:
|
151
|
+
- application/x-www-form-urlencoded
|
152
|
+
Accept-Encoding:
|
153
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
154
|
+
Accept:
|
155
|
+
- "*/*"
|
156
|
+
response:
|
157
|
+
status:
|
158
|
+
code: 201
|
159
|
+
message: Created
|
160
|
+
headers:
|
161
|
+
X-Frame-Options:
|
162
|
+
- SAMEORIGIN
|
163
|
+
X-Xss-Protection:
|
164
|
+
- 1; mode=block
|
165
|
+
X-Content-Type-Options:
|
166
|
+
- nosniff
|
167
|
+
Content-Type:
|
168
|
+
- application/json; charset=utf-8
|
169
|
+
Etag:
|
170
|
+
- '"f677c1a72db7b4a618661da0556a6c9b"'
|
171
|
+
Cache-Control:
|
172
|
+
- max-age=0, private, must-revalidate
|
173
|
+
X-Request-Id:
|
174
|
+
- 35f78a79-3cfb-442f-ac10-b59a19f811fa
|
175
|
+
X-Runtime:
|
176
|
+
- '0.092150'
|
177
|
+
Date:
|
178
|
+
- Thu, 03 Sep 2015 10:55:55 GMT
|
179
|
+
Connection:
|
180
|
+
- close
|
181
|
+
body:
|
182
|
+
encoding: UTF-8
|
183
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
184
|
+
need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:55.545Z","updated_at":"2015-09-03T10:55:55.545Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
185
|
+
http_version:
|
186
|
+
recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
|
187
|
+
- request:
|
188
|
+
method: delete
|
189
|
+
uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
|
190
|
+
body:
|
191
|
+
encoding: US-ASCII
|
192
|
+
string: ''
|
193
|
+
headers:
|
194
|
+
User-Agent:
|
195
|
+
- Faraday v0.9.1
|
196
|
+
Authorization:
|
197
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
198
|
+
Accept-Encoding:
|
199
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
200
|
+
Accept:
|
201
|
+
- "*/*"
|
202
|
+
response:
|
203
|
+
status:
|
204
|
+
code: 200
|
205
|
+
message: OK
|
206
|
+
headers:
|
207
|
+
X-Frame-Options:
|
208
|
+
- SAMEORIGIN
|
209
|
+
X-Xss-Protection:
|
210
|
+
- 1; mode=block
|
211
|
+
X-Content-Type-Options:
|
212
|
+
- nosniff
|
213
|
+
Content-Type:
|
214
|
+
- application/json; charset=utf-8
|
215
|
+
Etag:
|
216
|
+
- '"f677c1a72db7b4a618661da0556a6c9b"'
|
217
|
+
Cache-Control:
|
218
|
+
- max-age=0, private, must-revalidate
|
219
|
+
X-Request-Id:
|
220
|
+
- 79266fe8-3eb1-4ec3-9a0a-83923351bf64
|
221
|
+
X-Runtime:
|
222
|
+
- '0.026594'
|
223
|
+
Date:
|
224
|
+
- Thu, 03 Sep 2015 10:55:55 GMT
|
225
|
+
Connection:
|
226
|
+
- close
|
227
|
+
body:
|
228
|
+
encoding: UTF-8
|
229
|
+
string: '{"name":"Create Badge for Destroy","description":"This is a new badge","requirements":"You
|
230
|
+
need to love the Badge API","hint":"Love us..","image":"http://gamification-api.dev/badge_images/create-badge-for-destroy/badge.png","collection_id":"library","created_at":"2015-09-03T10:55:55.545Z","updated_at":"2015-09-03T10:55:55.545Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-destroy"}'
|
231
|
+
http_version:
|
232
|
+
recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
|
233
|
+
- request:
|
234
|
+
method: delete
|
235
|
+
uri: http://gamification-api.dev/v1/badges/create-badge-for-destroy
|
236
|
+
body:
|
237
|
+
encoding: US-ASCII
|
238
|
+
string: ''
|
239
|
+
headers:
|
240
|
+
User-Agent:
|
241
|
+
- Faraday v0.9.1
|
242
|
+
Authorization:
|
243
|
+
- Token token="c9cde524238644fa93393159e5e9ad87"
|
244
|
+
Accept-Encoding:
|
245
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
246
|
+
Accept:
|
247
|
+
- "*/*"
|
248
|
+
response:
|
249
|
+
status:
|
250
|
+
code: 404
|
251
|
+
message: Not Found
|
252
|
+
headers:
|
253
|
+
X-Frame-Options:
|
254
|
+
- SAMEORIGIN
|
255
|
+
X-Xss-Protection:
|
256
|
+
- 1; mode=block
|
257
|
+
X-Content-Type-Options:
|
258
|
+
- nosniff
|
259
|
+
Content-Type:
|
260
|
+
- application/json; charset=utf-8
|
261
|
+
Cache-Control:
|
262
|
+
- no-cache
|
263
|
+
X-Request-Id:
|
264
|
+
- d131b46d-5cba-49e2-abd5-976d91b061b2
|
265
|
+
X-Runtime:
|
266
|
+
- '0.012085'
|
267
|
+
Date:
|
268
|
+
- Thu, 03 Sep 2015 10:55:55 GMT
|
269
|
+
Connection:
|
270
|
+
- close
|
271
|
+
body:
|
272
|
+
encoding: UTF-8
|
273
|
+
string: '{"error":{"type":"invalid_request_error","message":"No badge exists
|
274
|
+
with id: create-badge-for-destroy","status":404}}'
|
275
|
+
http_version:
|
276
|
+
recorded_at: Thu, 03 Sep 2015 10:55:55 GMT
|
277
|
+
recorded_with: VCR 2.9.3
|