diff --git a/src/urlRouter.js b/src/urlRouter.js index 2dd296174..8ec704b92 100644 --- a/src/urlRouter.js +++ b/src/urlRouter.js @@ -305,12 +305,6 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { return listener; } - rules.sort(function(ruleA, ruleB) { - var aLength = ruleA.prefix ? ruleA.prefix.length : 0; - var bLength = ruleB.prefix ? ruleB.prefix.length : 0; - return bLength - aLength; - }); - if (!interceptDeferred) listen(); return { diff --git a/test/stateSpec.js b/test/stateSpec.js index 0ee8ee577..744e6fee4 100644 --- a/test/stateSpec.js +++ b/test/stateSpec.js @@ -111,7 +111,7 @@ describe('state', function () { } }) .state('resolveTimeout', { - url: "/:foo", + url: "/resolve-timeout/:foo", resolve: { value: function ($timeout) { return $timeout(function() { log += "Success!"; }, 1); diff --git a/test/urlRouterSpec.js b/test/urlRouterSpec.js index ef25460cc..d222378c1 100644 --- a/test/urlRouterSpec.js +++ b/test/urlRouterSpec.js @@ -55,8 +55,6 @@ describe("UrlRouter", function () { return path.replace('baz', 'b4z'); }).when('/foo/:param', function($match) { match = ['/foo/:param', $match]; - }).when('/foo/bar', function($match) { - match = ['/foo/bar', $match]; }).when('/bar', function($match) { match = ['/bar', $match]; }); @@ -73,18 +71,6 @@ describe("UrlRouter", function () { }); }); - it("should handle more specified url first", function() { - location.path("/foo/bar"); - scope.$emit("$locationChangeSuccess"); - expect(match[0]).toBe("/foo/bar"); - expect(match[1]).toEqual({}); - - location.path("/foo/baz"); - scope.$emit("$locationChangeSuccess"); - expect(match[0]).toBe("/foo/:param"); - expect(match[1]).toEqual({param: 'baz'}); - }); - it("should execute rewrite rules", function () { location.path("/foo"); scope.$emit("$locationChangeSuccess");