Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
revert: fix($route): update current route upon $route instantiation
Browse files Browse the repository at this point in the history
This reverts commit 2b344db.

I think I merged this commit prematurely and in addition to that
we found out that it's breaking google apps.

Jen Bourey will provide more info at the original PR #5681
  • Loading branch information
IgorMinar committed Jan 13, 2014
1 parent 2cd09c9 commit 3085987
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/ngRoute/route.js
Expand Up @@ -443,7 +443,6 @@ function $RouteProvider(){
}
};

updateRoute();

This comment has been minimized.

Copy link
@jdubois

jdubois Jan 14, 2014

I don't know exactly what this line does, but removing it has made all my tests to fail....

It's simple to test:
git clone https://github.com/jhipster/jhipster-sample-app
-> running "grunt test" works

do a "bower update"
-> "grunt test" does not work anymore

$rootScope.$on('$locationChangeSuccess', updateRoute);

return $route;
Expand Down
8 changes: 4 additions & 4 deletions test/ngRoute/routeSpec.js
Expand Up @@ -389,7 +389,7 @@ describe('$route', function() {
var onChangeSpy = jasmine.createSpy('onChange');

$rootScope.$on('$routeChangeStart', onChangeSpy);
expect($route.current).not.toBeUndefined();
expect($route.current).toBeUndefined();
expect(onChangeSpy).not.toHaveBeenCalled();

$location.path('/unknownRoute');
Expand Down Expand Up @@ -426,15 +426,15 @@ describe('$route', function() {

// init
$rootScope.$on('$routeChangeStart', onChangeSpy);
expect($route.current).not.toBeUndefined();
expect($route.current).toBeUndefined();
expect(onChangeSpy).not.toHaveBeenCalled();


// match otherwise route
$location.path('/unknownRoute');
$rootScope.$digest();

expect(currentRoute).not.toBeUndefined();
expect(currentRoute).toBeUndefined();
expect(nextRoute.templateUrl).toBe('404.html');
expect($route.current.templateUrl).toBe('404.html');
expect(onChangeSpy).toHaveBeenCalled();
Expand Down Expand Up @@ -770,7 +770,7 @@ describe('$route', function() {
var onChangeSpy = jasmine.createSpy('onChange');

$rootScope.$on('$routeChangeStart', onChangeSpy);
expect($route.current).not.toBeUndefined();
expect($route.current).toBeUndefined();
expect(onChangeSpy).not.toHaveBeenCalled();

$location.path('/');
Expand Down

0 comments on commit 3085987

Please sign in to comment.