fix(router): avoid two slash values between the baseHref and the path

This commit is contained in:
Matias Niemelä
2015-06-12 12:57:35 -07:00
committed by Brian Ford
parent e372cc779d
commit cdc7b03e67
2 changed files with 11 additions and 0 deletions
@@ -38,6 +38,14 @@ export function main() {
it('should not prepend urls with starting slash when an empty URL is provided',
() => { expect(location.normalizeAbsolutely('')).toEqual(browserLocation.baseHref); });
it('should not prepend path with an extra slash when a baseHref has a trailing slash', () => {
browserLocation = new DummyBrowserLocation();
browserLocation.spy('pushState');
browserLocation.baseHref = '/my/slashed/app/';
location = new Location(browserLocation);
expect(location.normalizeAbsolutely('/page')).toEqual('/my/slashed/app/page');
});
it('should not append urls with leading slash on navigate', () => {
location.go('/my/app/user/btford');
expect(browserLocation.spy('pushState'))