Merge pull request #1039 from PradnyaBaviskar/issue698
Add test case for loopback issue #698 Close #1039
This commit is contained in:
commit
8f8db5b69a
|
@ -99,6 +99,19 @@ describe('loopback.rest', function() {
|
|||
.expect(200, done);
|
||||
});
|
||||
|
||||
it('allows models to provide a custom HTTP path', function(done) {
|
||||
var ds = app.dataSource('db', { connector: loopback.Memory });
|
||||
var CustomModel = ds.createModel('CustomModel',
|
||||
{ name: String },
|
||||
{ http: { 'path': 'domain1/CustomModelPath' }
|
||||
});
|
||||
|
||||
app.model(CustomModel);
|
||||
app.use(loopback.rest());
|
||||
|
||||
request(app).get('/domain1/CustomModelPath').expect(200).end(done);
|
||||
});
|
||||
|
||||
it('includes loopback.token when necessary', function(done) {
|
||||
givenUserModelWithAuth();
|
||||
app.enableAuth();
|
||||
|
|
Loading…
Reference in New Issue