diff --git a/test/fixtures/simple-integration-app/models.json b/test/fixtures/simple-integration-app/models.json index 10a28a01..494367d7 100644 --- a/test/fixtures/simple-integration-app/models.json +++ b/test/fixtures/simple-integration-app/models.json @@ -30,7 +30,15 @@ "widget": { "properties": {}, "public": true, - "dataSource": "db" + "dataSource": "db", + "options": { + "relations": { + "store": { + "model": "store", + "type": "belongsTo" + } + } + } }, "store": { "properties": {}, diff --git a/test/relations.integration.js b/test/relations.integration.js index fb1493e2..c6decb26 100644 --- a/test/relations.integration.js +++ b/test/relations.integration.js @@ -96,6 +96,29 @@ describe('relations - integration', function () { }); }); + describe('/widgets/:id/store', function () { + beforeEach(function (done) { + var self = this; + this.store.widgets.create({ + name: this.widgetName + }, function(err, widget) { + self.widget = widget; + self.url = '/api/widgets/' + self.widget.id + '/store'; + done(); + }); + }); + lt.describe.whenCalledRemotely('GET', '/api/widgets/:id', function () { + it('should succeed with statusCode 200', function () { + assert.equal(this.res.statusCode, 200); + }); + }); + lt.describe.whenCalledRemotely('GET', '/api/widgets/:id/store', function () { + it('should succeed with statusCode 200', function () { + assert.equal(this.res.statusCode, 200); + }); + }); + }); + describe('hasAndBelongsToMany', function() { beforeEach(function defineProductAndCategoryModels() { var product = app.model(