Add an integration test for belongsTo remoting

This commit is contained in:
Raymond Feng 2014-04-03 20:43:49 -07:00
parent dff182ed27
commit cdbf45c53a
2 changed files with 32 additions and 1 deletions

View File

@ -30,7 +30,15 @@
"widget": {
"properties": {},
"public": true,
"dataSource": "db"
"dataSource": "db",
"options": {
"relations": {
"store": {
"model": "store",
"type": "belongsTo"
}
}
}
},
"store": {
"properties": {},

View File

@ -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(