Merge pull request #1040 from PradnyaBaviskar/feature/url-encoded-path

Add test case to demonstrate url-encoded http path
This commit is contained in:
Miroslav Bajtoš 2015-01-23 14:37:49 +01:00
commit c82e735190
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); 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) { it('includes loopback.token when necessary', function(done) {
givenUserModelWithAuth(); givenUserModelWithAuth();
app.enableAuth(); app.enableAuth();