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
@@ -0,0 +1,107 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gamification-api.dev/v1/badges/mega-book-worm/issue
6
+ body:
7
+ encoding: UTF-8
8
+ string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Authorization:
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Strict-Transport-Security:
26
+ - max-age=31536000
27
+ X-Frame-Options:
28
+ - SAMEORIGIN
29
+ X-Xss-Protection:
30
+ - 1; mode=block
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ Etag:
36
+ - '"824788f09e19d5f39dcafbadf0018c5b"'
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 2960fddc-b419-4a9c-b479-d799dde5541a
41
+ X-Runtime:
42
+ - '0.097128'
43
+ Date:
44
+ - Thu, 19 Nov 2015 15:41:33 GMT
45
+ Connection:
46
+ - close
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"total_score":75,"badges_total":2,"bronze_count":1,"silver_count":1,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
50
+ Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
51
+ out 25 books","hint":"You must like books...","image":"https://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:39:58.956Z","updated_at":"2015-11-18T11:39:58.956Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-18T11:40:26.379Z","id":"book-worm"},{"name":"Mega
52
+ Book Worm","description":"You have loaned out 50 books.","requirements":"Loan
53
+ out 50 books","hint":"You must really like books...","image":"https://gamification-api.dev/badge_images/mega-book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:40:05.068Z","updated_at":"2015-11-18T11:40:05.068Z","level":"silver","auto_issue":false,"status":"live","points":50,"object":"badge","issued_at":"2015-11-19T15:41:33.385Z","id":"mega-book-worm"}]}'
54
+ http_version:
55
+ recorded_at: Thu, 19 Nov 2015 15:41:33 GMT
56
+ - request:
57
+ method: post
58
+ uri: https://gamification-api.dev/v1/badges/mega-book-worm/revoke
59
+ body:
60
+ encoding: UTF-8
61
+ string: recipient=t.skarbek-wazynski%40lancaster.ac.uk
62
+ headers:
63
+ User-Agent:
64
+ - Faraday v0.9.2
65
+ Authorization:
66
+ - Token token="c9cde524238644fa93393159e5e9ad87"
67
+ Content-Type:
68
+ - application/x-www-form-urlencoded
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ Accept:
72
+ - "*/*"
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Strict-Transport-Security:
79
+ - max-age=31536000
80
+ X-Frame-Options:
81
+ - SAMEORIGIN
82
+ X-Xss-Protection:
83
+ - 1; mode=block
84
+ X-Content-Type-Options:
85
+ - nosniff
86
+ Content-Type:
87
+ - application/json; charset=utf-8
88
+ Etag:
89
+ - '"365681d5132a5e92b7946178e30b2356"'
90
+ Cache-Control:
91
+ - max-age=0, private, must-revalidate
92
+ X-Request-Id:
93
+ - 847b43c9-f970-4a82-95b7-3887d10b7f6e
94
+ X-Runtime:
95
+ - '0.054340'
96
+ Date:
97
+ - Thu, 19 Nov 2015 15:41:33 GMT
98
+ Connection:
99
+ - close
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"object":"recipient","badges":[{"name":"Book
103
+ Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan
104
+ out 25 books","hint":"You must like books...","image":"https://gamification-api.dev/badge_images/book-worm/badge.png","collection_id":"library","created_at":"2015-11-18T11:39:58.956Z","updated_at":"2015-11-18T11:39:58.956Z","level":"bronze","auto_issue":false,"status":"live","points":25,"object":"badge","issued_at":"2015-11-18T11:40:26.379Z","id":"book-worm"}]}'
105
+ http_version:
106
+ recorded_at: Thu, 19 Nov 2015 15:41:33 GMT
107
+ recorded_with: VCR 2.9.3
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://gamification-api.dev/v1/badges
5
+ uri: https://gamification-api.dev/v1/badges
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: badge%5Bcollection_id%5D=1&badge%5Bdescription%5D=This+is+a+new+badge&badge%5Bhint%5D=Love+us..&badge%5Blevel%5D=bronze&badge%5Bname%5D=Create+Badge+for+update&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
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
- - '"64cc3bfe4fa457cb1f24f998fb9cc877"'
36
+ - '"e121f0e3e1d17e7538159d1a447af7a8"'
35
37
  Cache-Control:
36
38
  - max-age=0, private, must-revalidate
37
39
  X-Request-Id:
38
- - 6a97fd1a-3cad-4a71-931d-96196fd3a68d
40
+ - 59a8339c-633a-4de6-8e1a-2aefdf107820
39
41
  X-Runtime:
40
- - '0.072552'
42
+ - '7.537254'
41
43
  Date:
42
- - Thu, 03 Sep 2015 10:56:01 GMT
44
+ - Thu, 19 Nov 2015 15:41:41 GMT
43
45
  Connection:
44
46
  - close
45
47
  body:
46
48
  encoding: UTF-8
47
49
  string: '{"name":"Create Badge for update","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-for-update/badge.png","collection_id":"library","created_at":"2015-09-03T10:56:00.983Z","updated_at":"2015-09-03T10:56:00.983Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-update"}'
50
+ need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge-for-update/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:33.658Z","updated_at":"2015-11-19T15:41:33.658Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-update"}'
49
51
  http_version:
50
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
52
+ recorded_at: Thu, 19 Nov 2015 15:41:41 GMT
51
53
  - request:
52
54
  method: patch
53
- uri: http://gamification-api.dev/v1/badges/create-badge-for-update
55
+ uri: https://gamification-api.dev/v1/badges/create-badge-for-update
54
56
  body:
55
57
  encoding: UTF-8
56
- string: badge%5Bcollection_id%5D=trim-trail&badge%5Bdescription%5D=Updated+Description&badge%5Bhint%5D=Updated+Hint&badge%5Bname%5D=Updated+Badge&badge%5Brequirements%5D=Updated+Requirements&badge%5Bstatus%5D=live
58
+ string: badge%5Bdescription%5D=Updated+Description&badge%5Bhint%5D=Updated+Hint&badge%5Bname%5D=Updated+Badge&badge%5Brequirements%5D=Updated+Requirements&badge%5Bstatus%5D=live
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
- - '"3ae1e3fd1bba522ad11c1d983e8e7b5d"'
86
+ - '"a615d7b0ae6696c7572a4f05146f86ed"'
83
87
  Cache-Control:
84
88
  - max-age=0, private, must-revalidate
85
89
  X-Request-Id:
86
- - 47698c58-428c-4ecd-993e-36695a45a5c4
90
+ - 9bd53713-718d-47bf-84e4-2b6eb941c638
87
91
  X-Runtime:
88
- - '0.069377'
92
+ - '7.055188'
89
93
  Date:
90
- - Thu, 03 Sep 2015 10:56:01 GMT
94
+ - Thu, 19 Nov 2015 15:41:48 GMT
91
95
  Connection:
92
96
  - close
93
97
  body:
94
98
  encoding: UTF-8
95
99
  string: '{"name":"Updated Badge","description":"Updated Description","requirements":"Updated
96
- Requirements","hint":"Updated Hint","image":"http://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:56:00.983Z","updated_at":"2015-09-03T10:56:01.070Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
100
+ Requirements","hint":"Updated Hint","image":"https://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:33.658Z","updated_at":"2015-11-19T15:41:41.251Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
97
101
  http_version:
98
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
102
+ recorded_at: Thu, 19 Nov 2015 15:41:48 GMT
99
103
  - request:
100
104
  method: delete
101
- uri: http://gamification-api.dev/v1/badges/create-badge-for-update
105
+ uri: https://gamification-api.dev/v1/badges/create-badge-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
- - '"3ae1e3fd1bba522ad11c1d983e8e7b5d"'
134
+ - '"a615d7b0ae6696c7572a4f05146f86ed"'
129
135
  Cache-Control:
130
136
  - max-age=0, private, must-revalidate
131
137
  X-Request-Id:
132
- - a1f67856-4738-4f27-bf2c-a9f58f70ce3d
138
+ - 4f9e884c-17f2-4d2f-bf5a-705a8a62fec5
133
139
  X-Runtime:
134
- - '0.028471'
140
+ - '0.029980'
135
141
  Date:
136
- - Thu, 03 Sep 2015 10:56:01 GMT
142
+ - Thu, 19 Nov 2015 15:41:48 GMT
137
143
  Connection:
138
144
  - close
139
145
  body:
140
146
  encoding: UTF-8
141
147
  string: '{"name":"Updated Badge","description":"Updated Description","requirements":"Updated
142
- Requirements","hint":"Updated Hint","image":"http://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:56:00.983Z","updated_at":"2015-09-03T10:56:01.070Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
148
+ Requirements","hint":"Updated Hint","image":"https://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:33.658Z","updated_at":"2015-11-19T15:41:41.251Z","level":"bronze","auto_issue":false,"status":"live","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
143
149
  http_version:
144
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
150
+ recorded_at: Thu, 19 Nov 2015 15:41:48 GMT
145
151
  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/badges
5
+ uri: https://gamification-api.dev/v1/badges
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: badge%5Bcollection_id%5D=1&badge%5Bdescription%5D=This+is+a+new+badge&badge%5Bhint%5D=Love+us..&badge%5Blevel%5D=bronze&badge%5Bname%5D=Create+Badge+for+update&badge%5Brequirements%5D=You+need+to+love+the+Badge+API
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
- - '"174370f656ce2bf2ac00d179859459cb"'
36
+ - '"1b689243be9e29031973c1b7f8421eee"'
35
37
  Cache-Control:
36
38
  - max-age=0, private, must-revalidate
37
39
  X-Request-Id:
38
- - ced0ec41-5b1e-4081-8868-4bab646cf169
40
+ - 34f5d283-c8fc-4371-a25b-2195e3945f56
39
41
  X-Runtime:
40
- - '0.071541'
42
+ - '7.511700'
41
43
  Date:
42
- - Thu, 03 Sep 2015 10:56:01 GMT
44
+ - Thu, 19 Nov 2015 15:41:55 GMT
43
45
  Connection:
44
46
  - close
45
47
  body:
46
48
  encoding: UTF-8
47
49
  string: '{"name":"Create Badge for update","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-for-update/badge.png","collection_id":"library","created_at":"2015-09-03T10:56:01.214Z","updated_at":"2015-09-03T10:56:01.214Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-update"}'
50
+ need to love the Badge API","hint":"Love us..","image":"https://gamification-api.dev/badge_images/create-badge-for-update/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:48.469Z","updated_at":"2015-11-19T15:41:48.469Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"create-badge-for-update"}'
49
51
  http_version:
50
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
52
+ recorded_at: Thu, 19 Nov 2015 15:41:55 GMT
51
53
  - request:
52
54
  method: patch
53
- uri: http://gamification-api.dev/v1/badges/create-badge-for-update
55
+ uri: https://gamification-api.dev/v1/badges/create-badge-for-update
54
56
  body:
55
57
  encoding: UTF-8
56
- string: badge%5Bcollection_id%5D=trim-trail&badge%5Bdescription%5D=Updated+Description&badge%5Bhint%5D=Updated+Hint&badge%5Bname%5D=Updated+Badge&badge%5Brequirements%5D=Updated+Requirements
58
+ string: badge%5Bdescription%5D=Updated+Description&badge%5Bhint%5D=Updated+Hint&badge%5Bname%5D=Updated+Badge&badge%5Brequirements%5D=Updated+Requirements
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
- - '"16df778d53540ec72b860dcfbf86fae0"'
86
+ - '"d3283d1bcc1e968ed0c701e14ef79fc4"'
83
87
  Cache-Control:
84
88
  - max-age=0, private, must-revalidate
85
89
  X-Request-Id:
86
- - 6b2e1586-be7d-4fc9-b2cb-8ccb74a9c26b
90
+ - f287018b-035f-41a0-8146-c5ad5a23aac1
87
91
  X-Runtime:
88
- - '0.073083'
92
+ - '7.708857'
89
93
  Date:
90
- - Thu, 03 Sep 2015 10:56:01 GMT
94
+ - Thu, 19 Nov 2015 15:42:03 GMT
91
95
  Connection:
92
96
  - close
93
97
  body:
94
98
  encoding: UTF-8
95
99
  string: '{"name":"Updated Badge","description":"Updated Description","requirements":"Updated
96
- Requirements","hint":"Updated Hint","image":"http://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:56:01.214Z","updated_at":"2015-09-03T10:56:01.301Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
100
+ Requirements","hint":"Updated Hint","image":"https://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:48.469Z","updated_at":"2015-11-19T15:41:56.058Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
97
101
  http_version:
98
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
102
+ recorded_at: Thu, 19 Nov 2015 15:42:03 GMT
99
103
  - request:
100
104
  method: get
101
- uri: http://gamification-api.dev/v1/badges/create-badge-for-update
105
+ uri: https://gamification-api.dev/v1/badges/create-badge-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
- - '"16df778d53540ec72b860dcfbf86fae0"'
134
+ - '"d3283d1bcc1e968ed0c701e14ef79fc4"'
129
135
  Cache-Control:
130
136
  - max-age=0, private, must-revalidate
131
137
  X-Request-Id:
132
- - ad53f14c-71bd-4450-8d7b-2a46de6951e6
138
+ - dbbaf043-83cb-463a-b9c4-3d77d462c8f6
133
139
  X-Runtime:
134
- - '0.013193'
140
+ - '0.014588'
135
141
  Date:
136
- - Thu, 03 Sep 2015 10:56:01 GMT
142
+ - Thu, 19 Nov 2015 15:42:03 GMT
137
143
  Connection:
138
144
  - close
139
145
  body:
140
146
  encoding: UTF-8
141
147
  string: '{"name":"Updated Badge","description":"Updated Description","requirements":"Updated
142
- Requirements","hint":"Updated Hint","image":"http://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:56:01.214Z","updated_at":"2015-09-03T10:56:01.301Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
148
+ Requirements","hint":"Updated Hint","image":"https://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:48.469Z","updated_at":"2015-11-19T15:41:56.058Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
143
149
  http_version:
144
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
150
+ recorded_at: Thu, 19 Nov 2015 15:42:03 GMT
145
151
  - request:
146
152
  method: delete
147
- uri: http://gamification-api.dev/v1/badges/create-badge-for-update
153
+ uri: https://gamification-api.dev/v1/badges/create-badge-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
- - '"16df778d53540ec72b860dcfbf86fae0"'
182
+ - '"d3283d1bcc1e968ed0c701e14ef79fc4"'
175
183
  Cache-Control:
176
184
  - max-age=0, private, must-revalidate
177
185
  X-Request-Id:
178
- - 2b896a5c-1114-4e64-935e-53904af44423
186
+ - 2a87d71e-e89d-4e22-8e4c-027e2058423b
179
187
  X-Runtime:
180
- - '0.027496'
188
+ - '0.030385'
181
189
  Date:
182
- - Thu, 03 Sep 2015 10:56:01 GMT
190
+ - Thu, 19 Nov 2015 15:42:03 GMT
183
191
  Connection:
184
192
  - close
185
193
  body:
186
194
  encoding: UTF-8
187
195
  string: '{"name":"Updated Badge","description":"Updated Description","requirements":"Updated
188
- Requirements","hint":"Updated Hint","image":"http://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"trim-trail","created_at":"2015-09-03T10:56:01.214Z","updated_at":"2015-09-03T10:56:01.301Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
196
+ Requirements","hint":"Updated Hint","image":"https://gamification-api.dev/badge_images/updated-badge/badge.png","collection_id":"library","created_at":"2015-11-19T15:41:48.469Z","updated_at":"2015-11-19T15:41:56.058Z","level":"bronze","auto_issue":false,"status":"draft","required_badges":[],"points":25,"object":"badge","id":"updated-badge"}'
189
197
  http_version:
190
- recorded_at: Thu, 03 Sep 2015 10:56:01 GMT
198
+ recorded_at: Thu, 19 Nov 2015 15:42:03 GMT
191
199
  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/collections
5
+ uri: https://gamification-api.dev/v1/collections
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
- - '"15a2f9f29e66f7ded667e8e9b8cc12e4"'
34
+ - '"f23681540ee7f0161e4275a9863ded74"'
33
35
  Cache-Control:
34
36
  - max-age=0, private, must-revalidate
35
37
  X-Request-Id:
36
- - 63d1d140-0d7d-435f-be9d-1fb5da5615f7
38
+ - 68a5feef-6024-4e60-8b2b-dc03cc964e74
37
39
  X-Runtime:
38
- - '0.015646'
40
+ - '0.008842'
39
41
  Date:
40
- - Thu, 03 Sep 2015 10:59:41 GMT
42
+ - Thu, 19 Nov 2015 14:32:06 GMT
41
43
  Connection:
42
44
  - close
43
45
  body:
44
46
  encoding: UTF-8
45
47
  string: '[{"id":"library","name":"Library","description":"Use your library and
46
- earn badges","created_at":"2015-09-03T10:51:07.747Z","updated_at":"2015-09-03T10:51:07.747Z","total_points_available":125,"badge_count":4,"object":"collection"},{"id":"trim-trail","name":"Trim
47
- Trail","description":"Get fit and health plus earn some badges","created_at":"2015-09-03T10:51:07.778Z","updated_at":"2015-09-03T10:51:07.778Z","total_points_available":100,"badge_count":2,"object":"collection"}]'
48
+ earn badges","created_at":"2015-11-18T11:39:58.859Z","updated_at":"2015-11-18T11:39:58.859Z","total_points_available":125,"badge_count":4,"object":"collection"},{"id":"trim-trail","name":"Trim
49
+ Trail","description":"Get fit and health plus earn some badges","created_at":"2015-11-18T11:39:58.898Z","updated_at":"2015-11-18T11:39:58.898Z","total_points_available":75,"badge_count":1,"object":"collection"}]'
48
50
  http_version:
49
- recorded_at: Thu, 03 Sep 2015 10:59:41 GMT
51
+ recorded_at: Thu, 19 Nov 2015 14:32:06 GMT
50
52
  recorded_with: VCR 2.9.3
@@ -0,0 +1,123 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://gamification-api.dev/v1/collections?expand=badges
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
+ - '"1205ce6b74bef5ab1f980d317d40ab40"'
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - 3327ab23-69a0-4f90-9420-87617244b765
39
+ X-Runtime:
40
+ - '0.020254'
41
+ Date:
42
+ - Thu, 19 Nov 2015 14:32:06 GMT
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: ASCII-8BIT
47
+ string: !binary |-
48
+ W3siaWQiOiJsaWJyYXJ5IiwibmFtZSI6IkxpYnJhcnkiLCJkZXNjcmlwdGlv
49
+ biI6IlVzZSB5b3VyIGxp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