diff --git a/docs/registry-post-route.md b/docs/registry-post-route.md index 8682c5c0f..8a6402358 100644 --- a/docs/registry-post-route.md +++ b/docs/registry-post-route.md @@ -11,20 +11,26 @@ curl http://my-components-registry.mydomain.com/ -d '{components:[{"name": hello-world", "version": "1.X.X"}, {"name": "my-component", "parameters": { "something": 2345 }}]}' [{ - "href": "https://my-components-registry.mydomain.com/hello-world/1.X.X", - "name": "hello-world", - "version": "1.0.0", - "requestVersion": "1.X.X", - "html": "Hello John doe!", - "type": "oc-component", - "renderMode": "rendered" + "status": 200, + "response": { + "href": "https://my-components-registry.mydomain.com/hello-world/1.X.X", + "name": "hello-world", + "version": "1.0.0", + "requestVersion": "1.X.X", + "html": "Hello John doe!", + "type": "oc-component", + "renderMode": "rendered" + } },{ - "href": "https://my-components-registry.mydomain.com/my-component/?something=2345", - "name": "my-component", - "version": "1.0.0", - "requestVersion": "", - "html": "Bla bla", - "type": "oc-component", - "renderMode": "rendered" + "status": 200, + "response": { + "href": "https://my-components-registry.mydomain.com/my-component/?something=2345", + "name": "my-component", + "version": "1.0.0", + "requestVersion": "", + "html": "Bla bla", + "type": "oc-component", + "renderMode": "rendered" + } }] ``` diff --git a/registry/routes/components.js b/registry/routes/components.js index dc006e8f8..dd5781ed0 100644 --- a/registry/routes/components.js +++ b/registry/routes/components.js @@ -49,7 +49,7 @@ module.exports = function(conf, repository){ parameters: component.parameters, version: component.version }, function(result){ - callback(null, result.response); + callback(null, result); }); }, function(err, results){ return res.json(200, results); diff --git a/test/acceptance/registry.js b/test/acceptance/registry.js index b56f8bf6e..1eea3ec9b 100644 --- a/test/acceptance/registry.js +++ b/test/acceptance/registry.js @@ -218,11 +218,16 @@ describe('registry', function(){ }); }); + it('should respond with two 200 status codes', function(){ + expect(result[0].status).to.equal(200); + expect(result[1].status).to.equal(200); + }); + it('should respond with two rendered components', function() { - expect(result[0].html).to.match(/Hello world!