diff --git a/lib/badgeapi/recipient.rb b/lib/badgeapi/recipient.rb index 339d9e2..f776996 100644 --- a/lib/badgeapi/recipient.rb +++ b/lib/badgeapi/recipient.rb @@ -3,7 +3,7 @@ module Badgeapi class Recipient < BadgeapiObject - attr_reader :total_score, :badges_total, :bronze_count, :silver_count, :gold_count, :platinum_count + attr_reader :total_score, :badges_total, :bronze_count, :silver_count, :gold_count, :platinum_count, :badges class << self diff --git a/lib/badgeapi/version.rb b/lib/badgeapi/version.rb index 4b43ab4..631608a 100644 --- a/lib/badgeapi/version.rb +++ b/lib/badgeapi/version.rb @@ -1,3 +1,3 @@ module Badgeapi - VERSION = "0.2.2" + VERSION = "0.2.3" end diff --git a/test/fixtures/all_collection.yml b/test/fixtures/all_collection.yml index 4c79348..7a9022a 100644 --- a/test/fixtures/all_collection.yml +++ b/test/fixtures/all_collection.yml @@ -33,11 +33,11 @@ http_interactions: Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - e3765b4e-8d76-4981-af08-223e174a2526 + - ce1e382f-9100-4f64-a0b9-23458ce90d05 X-Runtime: - - '0.013063' + - '0.012645' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -46,5 +46,5 @@ http_interactions: earn badges","created_at":"2015-07-16T09:21:22.292Z","updated_at":"2015-07-16T09:21:22.292Z","total_points_available":125},{"id":"trim-trail","name":"Trim Trail","description":"Get fit and health plus earn some badges","created_at":"2015-07-16T09:21:22.318Z","updated_at":"2015-07-16T09:21:22.318Z","total_points_available":100}]' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/all_collection_expanded.yml b/test/fixtures/all_collection_expanded.yml index ae3e8c7..691dce9 100644 --- a/test/fixtures/all_collection_expanded.yml +++ b/test/fixtures/all_collection_expanded.yml @@ -33,11 +33,11 @@ http_interactions: Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 0bad2e6f-41eb-4db6-aff9-dabd94631ac6 + - d417036c-6434-4522-8d69-0f006ef01a63 X-Runtime: - - '0.021558' + - '0.017408' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -116,5 +116,5 @@ http_interactions: bi1hcGkuZGV2L3VwbG9hZHMvYmFkZ2UvaW1hZ2UvNi9ncmV5X3NlZWQucG5n IiwicG9pbnRzIjo3NSwiaWQiOiJtYXJhdGhvbi1tYW4ifV19XQ== http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/all_collection_limit.yml b/test/fixtures/all_collection_limit.yml index 069d10b..2199a25 100644 --- a/test/fixtures/all_collection_limit.yml +++ b/test/fixtures/all_collection_limit.yml @@ -33,11 +33,11 @@ http_interactions: Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 47dacea3-3aef-479f-98a5-17c83d12028d + - e864e14c-2fe8-46c5-b428-449e23822df1 X-Runtime: - - '0.010887' + - '0.052726' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:37 GMT Connection: - close body: @@ -45,5 +45,5 @@ http_interactions: string: '[{"id":"library","name":"Library","description":"Use your library and earn badges","created_at":"2015-07-16T09:21:22.292Z","updated_at":"2015-07-16T09:21:22.292Z","total_points_available":125}]' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:37 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/bad_Recipient.yml b/test/fixtures/bad_Recipient.yml index 6bbd2e9..fb14bf4 100644 --- a/test/fixtures/bad_Recipient.yml +++ b/test/fixtures/bad_Recipient.yml @@ -31,11 +31,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 44afd28a-b2f1-40d0-a205-0732813a7e9c + - e17f9816-5c8b-4f8c-9ab2-4795f93410ae X-Runtime: - - '0.012492' + - '0.023507' Date: - - Fri, 17 Jul 2015 15:42:40 GMT + - Tue, 21 Jul 2015 08:10:13 GMT Connection: - close body: @@ -43,7 +43,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"Invalid search parameter: dfsgsdgg, must be university email address or university card number.","status":422}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:42:40 GMT + recorded_at: Tue, 21 Jul 2015 08:10:13 GMT - request: method: get uri: http://gamification-api.dev/v1/recipients?user=dfsgsdgg @@ -75,11 +75,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 2c89c8f8-d345-4e95-a935-c53a259f8cfb + - 3e4ce4ed-0c45-4614-8a37-302341b9146c X-Runtime: - - '0.010331' + - '0.011082' Date: - - Fri, 17 Jul 2015 15:42:40 GMT + - Tue, 21 Jul 2015 08:10:13 GMT Connection: - close body: @@ -87,7 +87,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"Invalid search parameter: dfsgsdgg, must be university email address or university card number.","status":422}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:42:40 GMT + recorded_at: Tue, 21 Jul 2015 08:10:13 GMT - request: method: get uri: http://gamification-api.dev/v1/recipients?user=j.stennet@lancaster.ac.uk @@ -119,11 +119,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 6721afae-9722-4e2a-81de-03658b5e481b + - b4b710d2-b893-411b-9f2f-ce2b8c52b0e0 X-Runtime: - - '0.016027' + - '0.021127' Date: - - Fri, 17 Jul 2015 15:42:40 GMT + - Tue, 21 Jul 2015 08:10:13 GMT Connection: - close body: @@ -131,7 +131,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"Unable to find user with specified data j.stennet@lancaster.ac.uk","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:42:40 GMT + recorded_at: Tue, 21 Jul 2015 08:10:13 GMT - request: method: get uri: http://gamification-api.dev/v1/recipients?user=j.stennet@lancaster.ac.uk @@ -163,11 +163,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - f867dd2b-2133-49a1-acaf-dedba7303203 + - 1756748d-2654-4a11-bf25-c7db9cb3697f X-Runtime: - - '0.015315' + - '0.021705' Date: - - Fri, 17 Jul 2015 15:42:41 GMT + - Tue, 21 Jul 2015 08:10:13 GMT Connection: - close body: @@ -175,5 +175,5 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"Unable to find user with specified data j.stennet@lancaster.ac.uk","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:42:41 GMT + recorded_at: Tue, 21 Jul 2015 08:10:13 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/collection_error.yml b/test/fixtures/collection_error.yml index 2e4ed36..5763758 100644 --- a/test/fixtures/collection_error.yml +++ b/test/fixtures/collection_error.yml @@ -31,11 +31,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - c93131fd-fe9d-4a9c-8c8f-d5fe6defb4e3 + - fef63824-79b3-40ac-856e-9f70fcb2e66f X-Runtime: - - '0.011030' + - '0.011343' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -43,7 +43,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"No collection exists with id: 27","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: get uri: http://gamification-api.dev/v1/collections/27 @@ -75,11 +75,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - fbdaa482-8ca4-4c6d-ac56-e262b44f4154 + - 6ef531fe-ceb4-4446-9c2b-75d14649dba4 X-Runtime: - - '0.014915' + - '0.009838' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -87,5 +87,5 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"No collection exists with id: 27","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/create_collection.yml b/test/fixtures/create_collection.yml index e9060b0..0795ef7 100644 --- a/test/fixtures/create_collection.yml +++ b/test/fixtures/create_collection.yml @@ -31,23 +31,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"f7c15a082bc259d900789ad6197adeb3"' + - '"a31568acdfd9c96090c17bddb6ce25bd"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 1fb9a5c6-1484-488e-8894-41a74497694e + - 67a761f6-f1c9-420e-8836-3ac9a6b027f5 X-Runtime: - - '0.023692' + - '0.021995' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-test","name":"Create Collection Test","description":"This - is a new collection","created_at":"2015-07-17T15:34:22.476Z","updated_at":"2015-07-17T15:34:22.476Z","total_points_available":0}' + is a new collection","created_at":"2015-07-21T08:10:38.247Z","updated_at":"2015-07-21T08:10:38.247Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-test @@ -77,21 +77,21 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"f7c15a082bc259d900789ad6197adeb3"' + - '"a31568acdfd9c96090c17bddb6ce25bd"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - f8a33eed-fbe1-49b4-a1ed-8a554f5e4e0b + - 2fd57496-87ff-4223-944b-cdfd2f411e72 X-Runtime: - - '0.016901' + - '0.016501' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-test","name":"Create Collection Test","description":"This - is a new collection","created_at":"2015-07-17T15:34:22.476Z","updated_at":"2015-07-17T15:34:22.476Z","total_points_available":0}' + is a new collection","created_at":"2015-07-21T08:10:38.247Z","updated_at":"2015-07-21T08:10:38.247Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/create_new_collection_failure.yml b/test/fixtures/create_new_collection_failure.yml index b0812a9..ff864a3 100644 --- a/test/fixtures/create_new_collection_failure.yml +++ b/test/fixtures/create_new_collection_failure.yml @@ -31,23 +31,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"ffd0c11e50e1c7362fa50880a6184503"' + - '"b92be85b21a9043aeb5797f9b37a91f1"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - fb7a6f64-6243-47c7-8fa0-332fc40a1ea2 + - 588b0694-ee68-4de4-a9a8-0fce12995e0a X-Runtime: - - '0.022876' + - '0.022285' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-test-destroy","name":"Create Collection Test - Destroy","description":"This is a new badge","created_at":"2015-07-17T15:34:22.560Z","updated_at":"2015-07-17T15:34:22.560Z","total_points_available":0}' + Destroy","description":"This is a new badge","created_at":"2015-07-21T08:10:38.331Z","updated_at":"2015-07-21T08:10:38.331Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: post uri: http://gamification-api.dev/v1/collections @@ -81,11 +81,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 8874844a-e042-415f-abe7-778f395f9182 + - 07ea79e3-4886-49f7-a6fe-b15910e172fa X-Runtime: - - '0.014141' + - '0.013549' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -93,7 +93,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":{"name":["has already been taken"]},"status":422}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: post uri: http://gamification-api.dev/v1/collections @@ -127,11 +127,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 2a4d9a69-b57d-4cb7-87db-01690d462af0 + - caf86945-51fe-4c21-9393-09eec87ca90e X-Runtime: - - '0.014775' + - '0.016145' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -139,7 +139,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":{"name":["has already been taken"]},"status":422}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-test-destroy @@ -169,21 +169,21 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"ffd0c11e50e1c7362fa50880a6184503"' + - '"b92be85b21a9043aeb5797f9b37a91f1"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 61e55917-92e4-40e3-84d9-82c9f2c84239 + - 6bc95cd8-0826-4fcf-aa01-1acfed7f5b5b X-Runtime: - - '0.014548' + - '0.016630' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-test-destroy","name":"Create Collection Test - Destroy","description":"This is a new badge","created_at":"2015-07-17T15:34:22.560Z","updated_at":"2015-07-17T15:34:22.560Z","total_points_available":0}' + Destroy","description":"This is a new badge","created_at":"2015-07-21T08:10:38.331Z","updated_at":"2015-07-21T08:10:38.331Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/destroy_collection.yml b/test/fixtures/destroy_collection.yml index 4c6f3ea..350bfe1 100644 --- a/test/fixtures/destroy_collection.yml +++ b/test/fixtures/destroy_collection.yml @@ -31,23 +31,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"0a95dab8d0ccf37b93491445a8b2856d"' + - '"c30f6ba90a7a7307c9a0d5f6fbf20c37"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - d22d100c-090a-40ba-a22e-1464efbfdc1f + - 42735666-96a1-433a-a597-b1d806ffca18 X-Runtime: - - '0.022415' + - '0.155874' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:37 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-for-destroy","name":"Create Collection for - Destroy","description":"This is a new badge","created_at":"2015-07-17T15:34:22.128Z","updated_at":"2015-07-17T15:34:22.128Z","total_points_available":0}' + Destroy","description":"This is a new badge","created_at":"2015-07-21T08:10:37.860Z","updated_at":"2015-07-21T08:10:37.860Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:37 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy @@ -77,23 +77,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"0a95dab8d0ccf37b93491445a8b2856d"' + - '"c30f6ba90a7a7307c9a0d5f6fbf20c37"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 7787297e-c959-4c75-8c70-b2bf440d0106 + - 1486ef9e-ae6e-4b44-8345-7e2e08bfc3e0 X-Runtime: - - '0.013431' + - '0.014190' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:37 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-for-destroy","name":"Create Collection for - Destroy","description":"This is a new badge","created_at":"2015-07-17T15:34:22.128Z","updated_at":"2015-07-17T15:34:22.128Z","total_points_available":0}' + Destroy","description":"This is a new badge","created_at":"2015-07-21T08:10:37.860Z","updated_at":"2015-07-21T08:10:37.860Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:37 GMT - request: method: get uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy @@ -125,11 +125,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - d6acb497-d028-44a9-a64e-aab01a23c491 + - 260d8891-f4d3-4de5-be0c-1f47634fd07f X-Runtime: - - '0.009042' + - '0.009515' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:37 GMT Connection: - close body: @@ -137,7 +137,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"No collection exists with id: create-collection-for-destroy","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:37 GMT - request: method: get uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy @@ -169,11 +169,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - dda9310b-1021-4515-93bb-62d1fd5bce9d + - 558a3a92-5f05-4816-ba94-3e9ea9a6d905 X-Runtime: - - '0.009911' + - '0.008781' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:37 GMT Connection: - close body: @@ -181,5 +181,5 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"No collection exists with id: create-collection-for-destroy","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:37 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/destroy_collection_error.yml b/test/fixtures/destroy_collection_error.yml index e60a8ed..6e51df9 100644 --- a/test/fixtures/destroy_collection_error.yml +++ b/test/fixtures/destroy_collection_error.yml @@ -31,23 +31,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"818de3d17631a1d857c356c71ff2b468"' + - '"b0d7bcc52771875ab4e1370f49eb7656"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 7a4c9715-f8c1-48fb-a99e-7e2cd0e63ed8 + - e26c342c-559a-49a2-9502-921796f8c01f X-Runtime: - - '0.021788' + - '0.022553' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-for-destroy","name":"Create Collection for - Destroy","description":"This is a new badge","created_at":"2015-07-17T15:34:22.270Z","updated_at":"2015-07-17T15:34:22.270Z","total_points_available":0}' + Destroy","description":"This is a new badge","created_at":"2015-07-21T08:10:38.017Z","updated_at":"2015-07-21T08:10:38.017Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy @@ -77,23 +77,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"818de3d17631a1d857c356c71ff2b468"' + - '"b0d7bcc52771875ab4e1370f49eb7656"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 29633eb7-762c-4dd3-9f67-e8a5c3bea86f + - 4eb11416-9192-4926-a063-6b14f3143f47 X-Runtime: - - '0.015567' + - '0.035041' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-for-destroy","name":"Create Collection for - Destroy","description":"This is a new badge","created_at":"2015-07-17T15:34:22.270Z","updated_at":"2015-07-17T15:34:22.270Z","total_points_available":0}' + Destroy","description":"This is a new badge","created_at":"2015-07-21T08:10:38.017Z","updated_at":"2015-07-21T08:10:38.017Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy @@ -125,11 +125,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 367f9ca2-3175-4d18-b00c-a3e4499f701f + - a41efdcf-f036-4263-af55-ca522c04c883 X-Runtime: - - '0.010716' + - '0.009264' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -137,7 +137,7 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"No collection exists with id: create-collection-for-destroy","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-for-destroy @@ -169,11 +169,11 @@ http_interactions: Cache-Control: - no-cache X-Request-Id: - - 7010fa7e-d4c8-4aa6-83a1-6038dcca4ef2 + - 8d0aa4f2-88f5-487d-bac4-f7f10912937c X-Runtime: - - '0.011128' + - '0.008732' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -181,5 +181,5 @@ http_interactions: string: '{"error":{"type":"invalid_request_error","message":"No collection exists with id: create-collection-for-destroy","status":404}}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/one_collection.yml b/test/fixtures/one_collection.yml index 908b644..297dc56 100644 --- a/test/fixtures/one_collection.yml +++ b/test/fixtures/one_collection.yml @@ -33,11 +33,11 @@ http_interactions: Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - e55d58b6-140a-4a27-8f9c-104cfd21f95d + - 17094c7a-4285-4121-bd85-532947ea852c X-Runtime: - - '0.011976' + - '0.012048' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -45,5 +45,5 @@ http_interactions: string: '{"id":"library","name":"Library","description":"Use your library and earn badges","created_at":"2015-07-16T09:21:22.292Z","updated_at":"2015-07-16T09:21:22.292Z","total_points_available":125}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/one_collection_expanded.yml b/test/fixtures/one_collection_expanded.yml index 124969c..08e3dcb 100644 --- a/test/fixtures/one_collection_expanded.yml +++ b/test/fixtures/one_collection_expanded.yml @@ -33,11 +33,11 @@ http_interactions: Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 201d1243-ea6d-4e9b-baa1-1d049d775389 + - 81c4e040-f829-4f2e-8a9d-a8f707ef55a8 X-Runtime: - - '0.015172' + - '0.019182' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: @@ -90,5 +90,5 @@ http_interactions: b2Fkcy9iYWRnZS9pbWFnZS80L2dyZXlfc2VlZC5wbmciLCJwb2ludHMiOjI1 LCJpZCI6Im91ci1iZXN0LWZyaWVuZCJ9XX0= http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/recipient_with_badges.yml b/test/fixtures/recipient_with_badges.yml index aa5c5c5..aa5da73 100644 --- a/test/fixtures/recipient_with_badges.yml +++ b/test/fixtures/recipient_with_badges.yml @@ -119,20 +119,22 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"0616856c23bcaead77926c29e5390c8b"' + - '"acde49a57ebc9ba795f6d09daff4d02a"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - fcce0934-7ac8-4dcc-8608-da193c47eab4 + - 73bab645-6adb-4dad-b848-872bd0fea119 X-Runtime: - - '0.022426' + - '0.031408' Date: - - Fri, 17 Jul 2015 15:42:41 GMT + - Tue, 21 Jul 2015 08:10:13 GMT Connection: - close body: encoding: UTF-8 - string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0}' + string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"badges":[{"name":"Book + Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan + out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/uploads/badge/image/1/seed.png","collection_id":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}]}' http_version: - recorded_at: Fri, 17 Jul 2015 15:42:41 GMT + recorded_at: Tue, 21 Jul 2015 08:10:13 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/recipient_with_badges_unicard.yml b/test/fixtures/recipient_with_badges_unicard.yml index 226ea49..daeac78 100644 --- a/test/fixtures/recipient_with_badges_unicard.yml +++ b/test/fixtures/recipient_with_badges_unicard.yml @@ -29,20 +29,22 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"0616856c23bcaead77926c29e5390c8b"' + - '"acde49a57ebc9ba795f6d09daff4d02a"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 98a1b3f4-d9d6-4490-81c3-75bf9b38ad22 + - 652bfafd-59e0-4bf5-8e1a-cbf1bad78399 X-Runtime: - - '2.873380' + - '2.344221' Date: - - Fri, 17 Jul 2015 15:42:43 GMT + - Tue, 21 Jul 2015 08:10:16 GMT Connection: - close body: encoding: UTF-8 - string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0}' + string: '{"total_score":25,"badges_total":1,"bronze_count":1,"silver_count":0,"gold_count":0,"platinum_count":0,"badges":[{"name":"Book + Worm","description":"You have loaned out over 25 books. Nice going!","requirements":"Loan + out 25 books","hint":"You must like books...","image":"http://gamification-api.dev/uploads/badge/image/1/seed.png","collection_id":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}]}' http_version: - recorded_at: Fri, 17 Jul 2015 15:42:43 GMT + recorded_at: Tue, 21 Jul 2015 08:10:16 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/update_collection.yml b/test/fixtures/update_collection.yml index 0555ff2..4d3eb93 100644 --- a/test/fixtures/update_collection.yml +++ b/test/fixtures/update_collection.yml @@ -31,23 +31,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"0bdaa62853686b4c7b6856c121c26021"' + - '"8c15a7ccdfc90ea59491dd09d49f839a"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 373bf165-61f5-42c2-a986-083c3b48420e + - fe0a3026-44c5-400b-a66d-c8770e4f3b0a X-Runtime: - - '0.022357' + - '0.021998' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-for-update","name":"Create Collection for - update","description":"This is a new collection","created_at":"2015-07-17T15:34:22.866Z","updated_at":"2015-07-17T15:34:22.866Z","total_points_available":0}' + update","description":"This is a new collection","created_at":"2015-07-21T08:10:38.642Z","updated_at":"2015-07-21T08:10:38.642Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: patch uri: http://gamification-api.dev/v1/collections/create-collection-for-update @@ -79,23 +79,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"79502e5c8521dfe7da27a9f3816241a1"' + - '"debba190cbaddc6f19823827e8fbe831"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 6f66dcba-b2be-4d7c-aefd-d05b11972127 + - 9f9d4010-ce90-479d-88b0-368588110f64 X-Runtime: - - '0.021738' + - '0.021909' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"updated-collection","name":"Updated Collection","description":"Updated - Collection","created_at":"2015-07-17T15:34:22.866Z","updated_at":"2015-07-17T15:34:22.907Z","total_points_available":0}' + Collection","created_at":"2015-07-21T08:10:38.642Z","updated_at":"2015-07-21T08:10:38.688Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: get uri: http://gamification-api.dev/v1/collections/create-collection-for-update @@ -125,23 +125,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"79502e5c8521dfe7da27a9f3816241a1"' + - '"debba190cbaddc6f19823827e8fbe831"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - ce86a011-7505-4761-a513-e1d6511732ca + - dc8c6e62-897e-4e09-9f2b-879a0340319c X-Runtime: - - '0.010186' + - '0.010183' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"updated-collection","name":"Updated Collection","description":"Updated - Collection","created_at":"2015-07-17T15:34:22.866Z","updated_at":"2015-07-17T15:34:22.907Z","total_points_available":0}' + Collection","created_at":"2015-07-21T08:10:38.642Z","updated_at":"2015-07-21T08:10:38.688Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-for-update @@ -171,21 +171,21 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"79502e5c8521dfe7da27a9f3816241a1"' + - '"debba190cbaddc6f19823827e8fbe831"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - e04a3ba4-5ee9-4833-980d-85e4224f9449 + - a21e779a-7a7e-4067-8042-8dde5654cad5 X-Runtime: - - '0.014891' + - '0.015193' Date: - - Fri, 17 Jul 2015 15:34:22 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"updated-collection","name":"Updated Collection","description":"Updated - Collection","created_at":"2015-07-17T15:34:22.866Z","updated_at":"2015-07-17T15:34:22.907Z","total_points_available":0}' + Collection","created_at":"2015-07-21T08:10:38.642Z","updated_at":"2015-07-21T08:10:38.688Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:22 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/fixtures/update_collection_via_update.yml b/test/fixtures/update_collection_via_update.yml index b525a09..8b742cb 100644 --- a/test/fixtures/update_collection_via_update.yml +++ b/test/fixtures/update_collection_via_update.yml @@ -31,23 +31,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"186a3d6f10a45a116e1cd5553661b7ef"' + - '"ed4d911ac6d260ea6a2b9d4176b5cfb2"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 00634a00-4a50-4292-902c-21d6eb924280 + - 1fdfebfd-587f-48de-8117-16ae5f66604e X-Runtime: - - '0.023017' + - '0.020674' Date: - - Fri, 17 Jul 2015 15:34:23 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"create-collection-for-update","name":"Create Collection for - update","description":"This is a new collection","created_at":"2015-07-17T15:34:23.016Z","updated_at":"2015-07-17T15:34:23.016Z","total_points_available":0}' + update","description":"This is a new collection","created_at":"2015-07-21T08:10:38.805Z","updated_at":"2015-07-21T08:10:38.805Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:23 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: patch uri: http://gamification-api.dev/v1/collections/create-collection-for-update @@ -79,23 +79,23 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"a780f7aa1671342a832e9b0d299fb2f3"' + - '"681beda6abf64888dccd45c36a2c3fe9"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - f6d07a79-85b1-4c3a-8bd0-8878797ac165 + - 8b2e1095-6c04-4c3b-8df5-2133884ce15e X-Runtime: - - '0.021653' + - '0.035176' Date: - - Fri, 17 Jul 2015 15:34:23 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"updated-badge","name":"Updated Badge","description":"Updated - Description","created_at":"2015-07-17T15:34:23.016Z","updated_at":"2015-07-17T15:34:23.059Z","total_points_available":0}' + Description","created_at":"2015-07-21T08:10:38.805Z","updated_at":"2015-07-21T08:10:38.857Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:23 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT - request: method: delete uri: http://gamification-api.dev/v1/collections/create-collection-for-update @@ -125,21 +125,21 @@ http_interactions: Content-Type: - application/json; charset=utf-8 Etag: - - '"a780f7aa1671342a832e9b0d299fb2f3"' + - '"681beda6abf64888dccd45c36a2c3fe9"' Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - ee12a39f-3dfa-4ff9-bfef-795bd5101ad7 + - 73a847f0-5e30-4d41-8069-415716404191 X-Runtime: - - '0.016888' + - '0.015241' Date: - - Fri, 17 Jul 2015 15:34:23 GMT + - Tue, 21 Jul 2015 08:10:38 GMT Connection: - close body: encoding: UTF-8 string: '{"id":"updated-badge","name":"Updated Badge","description":"Updated - Description","created_at":"2015-07-17T15:34:23.016Z","updated_at":"2015-07-17T15:34:23.059Z","total_points_available":0}' + Description","created_at":"2015-07-21T08:10:38.805Z","updated_at":"2015-07-21T08:10:38.857Z","total_points_available":0}' http_version: - recorded_at: Fri, 17 Jul 2015 15:34:23 GMT + recorded_at: Tue, 21 Jul 2015 08:10:38 GMT recorded_with: VCR 2.9.3 diff --git a/test/recipient/recipient_test.rb b/test/recipient/recipient_test.rb index 06acb05..1fcebc1 100644 --- a/test/recipient/recipient_test.rb +++ b/test/recipient/recipient_test.rb @@ -33,6 +33,8 @@ def test_it_return_back_recipient_stats assert_kind_of Integer, recipient.silver_count assert_kind_of Integer, recipient.gold_count assert_kind_of Integer, recipient.platinum_count + + assert_equal Badgeapi::Badge, recipient.badges.first.class end end @@ -50,6 +52,8 @@ def test_it_return_back_recipient_stats_with_unicard assert_kind_of Integer, recipient.silver_count assert_kind_of Integer, recipient.gold_count assert_kind_of Integer, recipient.platinum_count + + assert_equal Badgeapi::Badge, recipient.badges.first.class end end