diff options
Diffstat (limited to 'test/ng/urlUtilsSpec.js')
| -rw-r--r-- | test/ng/urlUtilsSpec.js | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/test/ng/urlUtilsSpec.js b/test/ng/urlUtilsSpec.js index 3c9bf847..18675ed8 100644 --- a/test/ng/urlUtilsSpec.js +++ b/test/ng/urlUtilsSpec.js @@ -1,29 +1,29 @@  'use strict'; -describe('$$urlUtils', function() { +describe('urlUtils', function() {    describe('parse', function() { -    it('should normalize a relative url', inject(function($$urlUtils) { -      expect($$urlUtils.resolve("foo")).toMatch(/^https?:\/\/[^/]+\/foo$/); -    })); +    it('should normalize a relative url', function () { +      expect(urlResolve("foo").href).toMatch(/^https?:\/\/[^/]+\/foo$/); +    }); -    it('should parse relative URL into component pieces', inject(function($$urlUtils) { -      var parsed = $$urlUtils.resolve("foo", true); +    it('should parse relative URL into component pieces', function () { +      var parsed = urlResolve("foo");        expect(parsed.href).toMatch(/https?:\/\//); -      expect(parsed.protocol).toMatch(/^https?:/); +      expect(parsed.protocol).toMatch(/^https?/);        expect(parsed.host).not.toBe("");        expect(parsed.hostname).not.toBe("");        expect(parsed.pathname).not.toBe(""); -    })); +    });    });    describe('isSameOrigin', function() { -    it('should support various combinations of urls - both string and parsed', inject(function($$urlUtils, $document) { +    it('should support various combinations of urls - both string and parsed', inject(function($document) {        function expectIsSameOrigin(url, expectedValue) { -        expect($$urlUtils.isSameOrigin(url)).toBe(expectedValue); -        expect($$urlUtils.isSameOrigin($$urlUtils.resolve(url, true))).toBe(expectedValue); +        expect(urlIsSameOrigin(url)).toBe(expectedValue); +        expect(urlIsSameOrigin(urlResolve(url, true))).toBe(expectedValue);        }        expectIsSameOrigin('path', true); -      var origin = $$urlUtils.resolve($document[0].location.href, true); +      var origin = urlResolve($document[0].location.href, true);        expectIsSameOrigin('//' + origin.host + '/path', true);        // Different domain.        expectIsSameOrigin('http://example.com/path', false); | 
