badgeapi 0.3.10 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -3,6 +3,10 @@ require './test/test_helper'
3
3
 
4
4
  class BadgeapiCollectionTest < MiniTest::Test
5
5
 
6
+ Badgeapi.api_base = 'https://gamification-api.dev/v1'
7
+ Badgeapi.ssl_ca_cert='/Users/tomskarbek/.tunnelss/ca/cert.pem'
8
+ Badgeapi.api_key = "c9cde524238644fa93393159e5e9ad87"
9
+
6
10
  def self.test_order
7
11
  :alpha
8
12
  end
@@ -20,105 +24,85 @@ class BadgeapiCollectionTest < MiniTest::Test
20
24
  end
21
25
 
22
26
  def test_it_returns_back_a_single_collection
23
- VCR.use_cassette('one_collection', :record => :all) do
24
- Badgeapi.api_key = "c9cde524238644fa93393159e5e9ad87"
25
-
27
+ VCR.use_cassette('collection_one') do
26
28
  collection = Badgeapi::Collection.find(1)
27
29
  assert_equal Badgeapi::Collection, collection.class
28
30
 
29
- assert_equal "library", collection.id
30
- assert_equal "Library", collection.name
31
- assert_equal 125, collection.total_points_available
32
- assert_equal 4, collection.badge_count
33
- assert_equal "Use your library and earn badges", collection.description
31
+ assert_kind_of String, collection.id
32
+ assert_kind_of String, collection.name
33
+ assert_kind_of Integer, collection.total_points_available
34
+ assert_kind_of Integer, collection.badge_count
35
+ assert_kind_of String, collection.description
34
36
  end
35
37
  end
36
38
 
37
39
  def test_it_returns_back_a_single_collection_expanded
38
- VCR.use_cassette('one_collection_expanded', :record => :all) do
39
- Badgeapi.api_key = "c9cde524238644fa93393159e5e9ad87"
40
-
40
+ VCR.use_cassette('collection_one_expanded') do
41
41
  collection = Badgeapi::Collection.find(1, expand: "badges")
42
42
 
43
43
  assert_equal Badgeapi::Collection, collection.class
44
44
 
45
- assert_equal "library", collection.id
46
- assert_equal "Library", collection.name
47
- assert_equal 125, collection.total_points_available
48
- assert_equal "Use your library and earn badges", collection.description
45
+ assert_kind_of String, collection.id
46
+ assert_kind_of String, collection.name
47
+ assert_kind_of Integer, collection.total_points_available
48
+ assert_kind_of String, collection.description
49
49
 
50
- assert_equal Badgeapi::Badge, collection.badges[1].required_badges.first.class
50
+ assert_kind_of Array, collection.badges
51
+ assert_kind_of Integer, collection.badges.length
51
52
 
52
- assert_equal Badgeapi::Badge, collection.badges[0].class
53
- assert_equal 4, collection.badges.length
54
- assert_equal "Book Worm", collection.badges[0].name
55
- assert_equal "bronze", collection.badges.first.level
56
- assert_equal 25, collection.badges.first.points
53
+ if collection.badges.length > 0
54
+ assert_kind_of String, collection.badges.first.name
55
+ assert_kind_of String, collection.badges.first.level
56
+ assert_kind_of Integer, collection.badges.first.points
57
+ end
57
58
  end
58
59
  end
59
60
 
60
61
  def test_it_returns_back_all_collections
61
- VCR.use_cassette('all_collection', :record => :all) do
62
- Badgeapi.api_key = "c9cde524238644fa93393159e5e9ad87"
63
-
62
+ VCR.use_cassette('collection_all') do
64
63
  result = Badgeapi::Collection.all
65
64
 
66
- # Make sure we got all the badges
67
- assert_equal 2, result.length
68
-
69
- # Make sure that the JSON was parsed
70
65
  assert result.kind_of?(Array)
71
66
  assert result.first.kind_of?(Badgeapi::Collection)
72
67
  end
73
68
  end
74
69
 
75
70
  def test_it_returns_back_all_collections_expanded
76
- VCR.use_cassette('all_collection_expanded', :record => :all) do
77
- Badgeapi.api_key = "c9cde524238644fa93393159e5e9ad87"
78
-
71
+ VCR.use_cassette('collection_all_expanded') do
79
72
  result = Badgeapi::Collection.all(expand: "badges")
80
73
 
81
- # Make sure we got all the badges
82
- assert_equal 2, result.length
83
-
84
- # Make sure that the JSON was parsed
85
74
  assert result.kind_of?(Array)
86
75
  assert result.first.kind_of?(Badgeapi::Collection)
87
76
  assert result.first.badges.first.kind_of?(Badgeapi::Badge)
88
- assert_equal "Book Worm", result.first.badges.first.name
89
- assert_equal "bronze", result.first.badges.first.level
90
- assert_equal 25, result.first.badges.first.points
91
-
92
77
 
93
- result.first.badges.each do |badge|
94
- assert_equal Badgeapi::Badge, badge.class
78
+ if result.first.badges.length > 0
79
+ assert_kind_of String, result.first.badges.first.name
80
+ assert_kind_of String, result.first.badges.first.level
81
+ assert_kind_of Integer, result.first.badges.first.points
82
+ result.first.badges.each do |badge|
83
+ assert_equal Badgeapi::Badge, badge.class
84
+ end
95
85
  end
96
86
  end
97
87
  end
98
88
 
99
89
  def test_all_limit
100
- VCR.use_cassette('all_collection_limit', :record => :all) do
101
- Badgeapi.api_key = "c9cde524238644fa93393159e5e9ad87"
102
-
90
+ VCR.use_cassette('collection_all_limit') do
103
91
  result = Badgeapi::Collection.all(limit: 1)
104
92
 
105
- # Make sure we got all the badges
106
93
  assert_equal 1, result.length
107
94
 
108
- # Make sure that the JSON was parsed
109
95
  assert result.kind_of?(Array)
110
96
  assert result.first.kind_of?(Badgeapi::Collection)
111
97
  end
112
98
  end
113
99
 
114
100
  def test_collections_raise_errors
115
- VCR.use_cassette('collection_error', :record => :all) do
116
- Badgeapi.api_key= 'c9cde524238644fa93393159e5e9ad87'
117
-
118
- assert_raises(Badgeapi::InvalidRequestError) { Badgeapi::Collection.find(27) }
101
+ VCR.use_cassette('collection_error') do
102
+ assert_raises(Badgeapi::InvalidRequestError) { Badgeapi::Collection.find("2df3") }
119
103
 
120
104
  begin
121
- Badgeapi::Collection.find(27)
105
+ Badgeapi::Collection.find("dgsgdsg")
122
106
  rescue Badgeapi::InvalidRequestError => e
123
107
  assert_equal(404, e.http_status)
124
108
  refute_empty e.message
@@ -128,10 +112,7 @@ class BadgeapiCollectionTest < MiniTest::Test
128
112
  end
129
113
 
130
114
  def test_create_a_new_collection
131
- VCR.use_cassette('create_collection', :record => :all) do
132
-
133
- Badgeapi.api_key = 'c9cde524238644fa93393159e5e9ad87'
134
-
115
+ VCR.use_cassette('collection_create') do
135
116
  collection = Badgeapi::Collection.create(
136
117
  name: "Create Collection Test",
137
118
  description: "This is a new collection"
@@ -146,10 +127,7 @@ class BadgeapiCollectionTest < MiniTest::Test
146
127
  end
147
128
 
148
129
  def test_create_new_collection_failure
149
- VCR.use_cassette('create_new_collection_failure', :record => :all) do
150
-
151
- Badgeapi.api_key = 'c9cde524238644fa93393159e5e9ad87'
152
-
130
+ VCR.use_cassette('collection_create_new_failure') do
153
131
  collection = Badgeapi::Collection.create(
154
132
  name: "Create Collection Test Destroy",
155
133
  description: "This is a new badge"
@@ -178,10 +156,7 @@ class BadgeapiCollectionTest < MiniTest::Test
178
156
  end
179
157
 
180
158
  def test_collection_destroy
181
- VCR.use_cassette('destroy_collection', :record => :all) do
182
-
183
- Badgeapi.api_key = 'c9cde524238644fa93393159e5e9ad87'
184
-
159
+ VCR.use_cassette('collection_destroy') do
185
160
  collection = Badgeapi::Collection.create(
186
161
  name: "Create Collection for Destroy",
187
162
  description: "This is a new badge",
@@ -204,16 +179,13 @@ class BadgeapiCollectionTest < MiniTest::Test
204
179
  end
205
180
 
206
181
  def test_collection_destroy_error
207
- VCR.use_cassette('destroy_collection_error', :record => :all) do
208
-
209
- Badgeapi.api_key = 'c9cde524238644fa93393159e5e9ad87'
210
-
182
+ VCR.use_cassette('collection_destroy_error') do
211
183
  collection = Badgeapi::Collection.create(
212
184
  name: "Create Collection for Destroy",
213
185
  description: "This is a new badge"
214
186
  )
215
187
 
216
- destroyed_collection = Badgeapi::Collection.destroy(collection.id)
188
+ Badgeapi::Collection.destroy(collection.id)
217
189
 
218
190
  assert_raises(Badgeapi::InvalidRequestError) { Badgeapi::Collection.destroy(collection.id) }
219
191
 
@@ -228,10 +200,7 @@ class BadgeapiCollectionTest < MiniTest::Test
228
200
  end
229
201
 
230
202
  def test_update_collection
231
- VCR.use_cassette('update_collection', :record => :all) do
232
-
233
- Badgeapi.api_key= 'c9cde524238644fa93393159e5e9ad87'
234
-
203
+ VCR.use_cassette('collection_update') do
235
204
  collection = Badgeapi::Collection.create(
236
205
  name: "Create Collection for update",
237
206
  description: "This is a new collection",
@@ -252,10 +221,7 @@ class BadgeapiCollectionTest < MiniTest::Test
252
221
  end
253
222
 
254
223
  def test_update_collection_via_update
255
- VCR.use_cassette('update_collection_via_update', :record => :all) do
256
-
257
- Badgeapi.api_key= 'c9cde524238644fa93393159e5e9ad87'
258
-
224
+ VCR.use_cassette('collection_update_via_update') do
259
225
  collection = Badgeapi::Collection.create(
260
226
  name: "Create Collection for update",
261
227
  description: "This is a new collection",
@@ -272,4 +238,4 @@ class BadgeapiCollectionTest < MiniTest::Test
272
238
  Badgeapi::Collection.destroy(collection.id)
273
239
  end
274
240
  end
275
- end
241
+ end
@@ -0,0 +1,113 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://gamification-api.dev/v1/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
+ - '"5f704da90d65adc9376cbe0ff451e250"'
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - bd3015b7-c281-470a-babe-3b6c4028ce57
39
+ X-Runtime:
40
+ - '0.026868'
41
+ Date:
42
+ - Thu, 19 Nov 2015 15:41:27 GMT
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: ASCII-8BIT
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
97
+ aXNzdWUiOmZhbHNlLCJzdGF0dXMiOiJsaXZlIiwicmVxdWlyZWRfYmFkZ2Vz
98
+ IjpbXSwicG9pbnRzIjoyNSwib2JqZWN0IjoiYmFkZ2UiLCJpZCI6Im91ci1i
99
+ ZXN0LWZyaWVuZCJ9LHsibmFtZSI6Ik1hcmF0aG9uIE1hbiIsImRlc2NyaXB0
100
+ aW9uIjoiWW91IGhhdmUgcnVuIDEwIGxhcHMgb2YgdGhlIHRyaXBzIHRyYWls
101
+ IHRoYXQgaXMgNDcga2lsb21ldGVycyIsInJlcXVpcmVtZW50cyI6IkNvbXBs
102
+ ZXRlIDEwIGxhcHMgb2YgdGhlIHRyaW0gdHJhaWwgb3ZlciBhbnkgdGltZSIs
103
+ ImhpbnQiOiJLZWVwIGdvaW5nLi4uIiwiaW1hZ2UiOiJodHRwczovL2dhbWlm
104
+ aWNhdGlvbi1hcGkuZGV2L2JhZGdlX2ltYWdlcy9tYXJhdGhvbi1tYW4vYmFk
105
+ Z2UucG5nIiwiY29sbGVjdGlvbl9pZCI6InRyaW0tdHJhaWwiLCJjcmVhdGVk
106
+ X2F0IjoiMjAxNS0xMS0xOFQxMTo0MDoyMC4zMDNaIiwidXBkYXRlZF9hdCI6
107
+ IjIwMTUtMTEtMThUMTE6NDA6MjAuMzAzWiIsImxldmVsIjoiZ29sZCIsImF1
108
+ dG9faXNzdWUiOmZhbHNlLCJzdGF0dXMiOiJsaXZlIiwicmVxdWlyZWRfYmFk
109
+ Z2VzIjpbXSwicG9pbnRzIjo3NSwib2JqZWN0IjoiYmFkZ2UiLCJpZCI6Im1h
110
+ cmF0aG9uLW1hbiJ9XQ==
111
+ http_version:
112
+ recorded_at: Thu, 19 Nov 2015 15:41:27 GMT
113
+ recorded_with: VCR 2.9.3
@@ -2,48 +2,49 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://gamification-api.dev/v1/badges
5
+ uri: https://gamification-api.dev/v1/badges?user=t.skarbek-wazynski
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
- - Token token="foo"
13
+ - Token token="c9cde524238644fa93393159e5e9ad87"
14
14
  Accept-Encoding:
15
15
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
16
  Accept:
17
17
  - "*/*"
18
18
  response:
19
19
  status:
20
- code: 401
21
- message: Unauthorized
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:
26
28
  - 1; mode=block
27
29
  X-Content-Type-Options:
28
30
  - nosniff
29
- Www-Authenticate:
30
- - Token realm="Application"
31
31
  Content-Type:
32
32
  - application/json; charset=utf-8
33
33
  Cache-Control:
34
34
  - no-cache
35
35
  X-Request-Id:
36
- - c4135b29-488b-4c1e-b35c-85743e8e435e
36
+ - 6efbcce7-6f0e-430d-9b35-936177f6c04d
37
37
  X-Runtime:
38
- - '0.010614'
38
+ - '0.022712'
39
39
  Date:
40
- - Thu, 16 Jul 2015 10:39:45 GMT
40
+ - Thu, 19 Nov 2015 15:41:25 GMT
41
41
  Connection:
42
42
  - close
43
43
  body:
44
44
  encoding: UTF-8
45
- string: '{"error":{"type":"invalid_request_error","message":"The API key is
46
- missing or invalid","status":401}}'
45
+ string: '{"error":{"type":"invalid_request_error","message":"Unable to find
46
+ user with specified data t.skarbek-wazynski. Recipient data must be a university
47
+ email address, university card number or username.","status":404}}'
47
48
  http_version:
48
- recorded_at: Thu, 16 Jul 2015 10:39:45 GMT
49
+ recorded_at: Thu, 19 Nov 2015 15:41:26 GMT
49
50
  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?user=t.skarbek-wazynski
5
+ uri: https://gamification-api.dev/v1/badges?user=t.skarbek-wazynsky@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
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: 404
21
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,56 +33,11 @@ http_interactions:
31
33
  Cache-Control:
32
34
  - no-cache
33
35
  X-Request-Id:
34
- - db1f2728-a172-467b-8339-16cb17a2ec11
36
+ - 7845fa80-bb89-4a7a-ab0f-0145d897c303
35
37
  X-Runtime:
36
- - '0.015889'
38
+ - '0.023965'
37
39
  Date:
38
- - Thu, 03 Sep 2015 10:55:56 GMT
39
- Connection:
40
- - close
41
- body:
42
- encoding: UTF-8
43
- string: '{"error":{"type":"invalid_request_error","message":"Unable to find
44
- user with specified data t.skarbek-wazynski. Recipient data must be a university
45
- email address, university card number or username.","status":404}}'
46
- http_version:
47
- recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
48
- - request:
49
- method: get
50
- uri: http://gamification-api.dev/v1/badges?user=t.skarbek-wazynsky@lancaster.ac.uk
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: 404
66
- message: Not Found
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
- - 74d8df1b-c7aa-43f6-b7d5-812ab3bc175d
80
- X-Runtime:
81
- - '0.018328'
82
- Date:
83
- - Thu, 03 Sep 2015 10:55:56 GMT
40
+ - Thu, 19 Nov 2015 15:41:26 GMT
84
41
  Connection:
85
42
  - close
86
43
  body:
@@ -89,16 +46,16 @@ http_interactions:
89
46
  user with specified data t.skarbek-wazynsky@lancaster.ac.uk. Recipient data
90
47
  must be a university email address, university card number or username.","status":404}}'
91
48
  http_version:
92
- recorded_at: Thu, 03 Sep 2015 10:55:56 GMT
49
+ recorded_at: Thu, 19 Nov 2015 15:41:26 GMT
93
50
  - request:
94
51
  method: get
95
- uri: http://gamification-api.dev/v1/badges?user=081897144451
52
+ uri: https://gamification-api.dev/v1/badges?user=081897144451
96
53
  body:
97
54
  encoding: US-ASCII
98
55
  string: ''
99
56
  headers:
100
57
  User-Agent:
101
- - Faraday v0.9.1
58
+ - Faraday v0.9.2
102
59
  Authorization:
103
60
  - Token token="c9cde524238644fa93393159e5e9ad87"
104
61
  Accept-Encoding:
@@ -110,6 +67,8 @@ http_interactions:
110
67
  code: 404
111
68
  message: Not Found
112
69
  headers:
70
+ Strict-Transport-Security:
71
+ - max-age=31536000
113
72
  X-Frame-Options:
114
73
  - SAMEORIGIN
115
74
  X-Xss-Protection:
@@ -121,11 +80,11 @@ http_interactions:
121
80
  Cache-Control:
122
81
  - no-cache
123
82
  X-Request-Id:
124
- - 11d59226-2cfe-4384-9e34-d9c2e29b9b57
83
+ - cfd52b7c-a043-4a0b-bf8f-6b19de51f562
125
84
  X-Runtime:
126
- - '0.981996'
85
+ - '1.462492'
127
86
  Date:
128
- - Thu, 03 Sep 2015 10:55:57 GMT
87
+ - Thu, 19 Nov 2015 15:41:27 GMT
129
88
  Connection:
130
89
  - close
131
90
  body:
@@ -134,5 +93,5 @@ http_interactions:
134
93
  user with specified data 081897144451. Recipient data must be a university
135
94
  email address, university card number or username.","status":404}}'
136
95
  http_version:
137
- recorded_at: Thu, 03 Sep 2015 10:55:57 GMT
96
+ recorded_at: Thu, 19 Nov 2015 15:41:27 GMT
138
97
  recorded_with: VCR 2.9.3