From c5217a6aaee99d1c35b1e60968dd79d959e91f24 Mon Sep 17 00:00:00 2001 From: Adam Magaluk Date: Wed, 1 Jun 2016 09:47:33 -0400 Subject: [PATCH] Added rel["item"] to sub-entities of peer management api. With tests (#315) --- lib/api_resources/peer_management.js | 1 + test/test_api.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/api_resources/peer_management.js b/lib/api_resources/peer_management.js index 91e360a..233f350 100644 --- a/lib/api_resources/peer_management.js +++ b/lib/api_resources/peer_management.js @@ -260,6 +260,7 @@ PeerManagementBuilder.prototype.entities = function() { var entity = { class: ['peer'], + rel: ['item'], properties: { id: peer.id, name: peer.id, diff --git a/test/test_api.js b/test/test_api.js index 5e355e0..880da68 100644 --- a/test/test_api.js +++ b/test/test_api.js @@ -496,6 +496,19 @@ describe('Zetta Api', function() { .end(done); }); + it('subentities should have rel ["item"]', function(done) { + peerRegistry.save({ id: '0' }, function() { + request(getHttpServer(app)) + .get('/peer-management') + .expect(getBody(function(err, body) { + body.entities.forEach(function(entity) { + assert(entity.rel.indexOf('item') >= 0) + }) + })) + .end(done); + }); + }); + it('should list saved peers', function(done) { peerRegistry.save({ id: '0' }, function() { request(getHttpServer(app))