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