Skip to content

Commit

Permalink
Added rel["item"] to sub-entities of peer management api. With tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamMagaluk committed Jun 1, 2016
1 parent 350c81f commit c5217a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/api_resources/peer_management.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ PeerManagementBuilder.prototype.entities = function() {

var entity = {
class: ['peer'],
rel: ['item'],
properties: {
id: peer.id,
name: peer.id,
Expand Down
13 changes: 13 additions & 0 deletions test/test_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c5217a6

Please sign in to comment.