Add root true to remote methods
This commit is contained in:
parent
d3eed3b321
commit
8a7086be5c
|
@ -106,6 +106,8 @@ Model.setup = function () {
|
|||
{path: '/'},
|
||||
{path: '/:id'}
|
||||
];
|
||||
|
||||
ModelCtor.sharedCtor.returns = {root: true};
|
||||
|
||||
return ModelCtor;
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ User.setup = function () {
|
|||
accepts: [
|
||||
{arg: 'credentials', type: 'object', required: true, http: {source: 'body'}}
|
||||
],
|
||||
returns: {arg: 'session', type: 'object'},
|
||||
returns: {arg: 'session', type: 'object', root: true},
|
||||
http: {verb: 'post'}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -275,7 +275,7 @@ describe('Model', function() {
|
|||
{arg: 'username', type: 'string', required: true},
|
||||
{arg: 'password', type: 'string', required: true}
|
||||
],
|
||||
returns: {arg: 'sessionId', type: 'any'},
|
||||
returns: {arg: 'sessionId', type: 'any', root: true},
|
||||
http: {path: '/sign-in', verb: 'get'}
|
||||
}
|
||||
);
|
||||
|
@ -292,7 +292,7 @@ describe('Model', function() {
|
|||
.expect(200)
|
||||
.end(function(err, res){
|
||||
if(err) return done(err);
|
||||
assert(res.body.$data === 123);
|
||||
assert.equal(res.body, 123);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -132,7 +132,7 @@ describe('User', function(){
|
|||
function logout(err, sid) {
|
||||
request(app)
|
||||
.post('/users/logout')
|
||||
.expect(200)
|
||||
.expect(204)
|
||||
.send({sid: sid})
|
||||
.end(verify(sid, done));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue