Add test case to demonstrate url-encoded http path

This commit is contained in:
Pradnya Baviskar 2015-01-23 18:34:13 +05:30
parent fc31f37a83
commit b27b13071a
1 changed files with 13 additions and 0 deletions

View File

@ -112,6 +112,19 @@ describe('loopback.rest', function() {
request(app).get('/domain1/CustomModelPath').expect(200).end(done);
});
it('should report 200 for url-encoded HTTP path', function(done) {
var ds = app.dataSource('db', { connector: loopback.Memory });
var CustomModel = ds.createModel('CustomModel',
{ name: String },
{ http: { path: 'domain%20one/CustomModelPath' }
});
app.model(CustomModel);
app.use(loopback.rest());
request(app).get('/domain%20one/CustomModelPath').expect(200).end(done);
});
it('includes loopback.token when necessary', function(done) {
givenUserModelWithAuth();
app.enableAuth();