diff --git a/packages/@ember/-internals/routing/lib/location/history_location.ts b/packages/@ember/-internals/routing/lib/location/history_location.ts index 8506fe9a6db..735cc39500b 100644 --- a/packages/@ember/-internals/routing/lib/location/history_location.ts +++ b/packages/@ember/-internals/routing/lib/location/history_location.ts @@ -129,7 +129,7 @@ export default class HistoryLocation extends EmberObject implements EmberLocatio let url = path .replace(new RegExp(`^${baseURL}(?=/|$)`), '') .replace(new RegExp(`^${rootURL}(?=/|$)`), '') - .replace(/\/\/$/g, '/'); // remove extra slashes + .replace(/\/\//g, '/'); // remove extra slashes let search = location.search || ''; url += search + this.getHash(); diff --git a/packages/@ember/-internals/routing/tests/location/history_location_test.js b/packages/@ember/-internals/routing/tests/location/history_location_test.js index 21e2826213e..72501016d10 100644 --- a/packages/@ember/-internals/routing/tests/location/history_location_test.js +++ b/packages/@ember/-internals/routing/tests/location/history_location_test.js @@ -288,15 +288,15 @@ moduleFor( HistoryTestLocation.reopen({ init() { this._super(...arguments); - let location = mockBrowserLocation('//'); - location.pathname = '//'; // mockBrowserLocation does not allow for `//`, so force it + let location = mockBrowserLocation('//admin//profile//'); + location.pathname = '//admin//profile//'; // mockBrowserLocation does not allow for `//`, so force it set(this, 'location', location); }, }); createLocation(); - assert.equal(location.getURL(), '/'); + assert.equal(location.getURL(), '/admin/profile/'); } ['@test Existing state is preserved on init'](assert) {