diff options
| author | Jeff Cross | 2013-11-26 11:36:36 -0800 |
|---|---|---|
| committer | Jeff Cross | 2013-11-26 18:31:27 -0800 |
| commit | 736c8fbbae57a209f4ba570e38cc3bd0745a9569 (patch) | |
| tree | 7f6516f1792fc2a1e1828d38228542c4c40c748d /test/ng/urlUtilsSpec.js | |
| parent | 947562220d7d1c851f138a816f7530738b97e7b6 (diff) | |
| download | angular.js-736c8fbbae57a209f4ba570e38cc3bd0745a9569.tar.bz2 | |
refactor($location): move file://+win path fix to $location
The urlResolve method was fixed to automatically remove the
volume label from path names to fix issues with the file
protocol on windows where $location.path() was returning
paths where the first segment would be the volume name,
such as "/C:/mypath". See #4942 and #4928
However, the solution was specific to the $location non-
HTML5 mode, and was implemented at a lower level of
abstraction than it should have been. This refactor moves
the fix to inside of the LocationHashBangUrl $$parse method.
Closes #5041
Diffstat (limited to 'test/ng/urlUtilsSpec.js')
| -rw-r--r-- | test/ng/urlUtilsSpec.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ng/urlUtilsSpec.js b/test/ng/urlUtilsSpec.js index 18675ed8..543ff3fb 100644 --- a/test/ng/urlUtilsSpec.js +++ b/test/ng/urlUtilsSpec.js @@ -1,7 +1,7 @@ 'use strict'; describe('urlUtils', function() { - describe('parse', function() { + describe('urlResolve', function() { it('should normalize a relative url', function () { expect(urlResolve("foo").href).toMatch(/^https?:\/\/[^/]+\/foo$/); }); @@ -14,6 +14,13 @@ describe('urlUtils', function() { expect(parsed.hostname).not.toBe(""); expect(parsed.pathname).not.toBe(""); }); + + + it('should return pathname as / if empty path provided', function () { + //IE counts / as empty, necessary to use / so that pathname is not context.html + var parsed = urlResolve('/'); + expect(parsed.pathname).toBe('/'); + }) }); describe('isSameOrigin', function() { |
