Add an integration test for belongsTo remoting
This commit is contained in:
parent
dff182ed27
commit
cdbf45c53a
|
@ -30,7 +30,15 @@
|
|||
"widget": {
|
||||
"properties": {},
|
||||
"public": true,
|
||||
"dataSource": "db"
|
||||
"dataSource": "db",
|
||||
"options": {
|
||||
"relations": {
|
||||
"store": {
|
||||
"model": "store",
|
||||
"type": "belongsTo"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"store": {
|
||||
"properties": {},
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue