diff options
| author | quazzie | 2013-03-22 10:35:50 +0100 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-05-01 14:42:10 +0100 |
| commit | dc9a580617a838b63cbf5feae362b6f9cf5ed986 (patch) | |
| tree | 5ccc531294e2039425acd9627d28ef09c4ff59d1 /test/ng/locationSpec.js | |
| parent | 660605bdb834bbbb31529b86f5b870c5861ff497 (diff) | |
| download | angular.js-dc9a580617a838b63cbf5feae362b6f9cf5ed986.tar.bz2 | |
fix($location): back-button should fire $locationChangeStart
Before $locationChangeStart event is not broadcast when pressing the back-button on the browser.
Closes #2109
Diffstat (limited to 'test/ng/locationSpec.js')
| -rw-r--r-- | test/ng/locationSpec.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js index bb0659a5..fb828044 100644 --- a/test/ng/locationSpec.js +++ b/test/ng/locationSpec.js @@ -1237,7 +1237,7 @@ describe('$location', function() { expect($location.url()).toEqual(''); $rootScope.$on('$locationChangeStart', function(event, newUrl, oldUrl) { - throw Error('there is no before when user enters URL directly to browser'); + $log.info('start', newUrl, oldUrl); }); $rootScope.$on('$locationChangeSuccess', function(event, newUrl, oldUrl) { $log.info('after', newUrl, oldUrl); @@ -1248,6 +1248,8 @@ describe('$location', function() { $browser.poll(); expect($log.info.logs.shift()). + toEqual(['start', 'http://server/#/somePath', 'http://server/']); + expect($log.info.logs.shift()). toEqual(['after', 'http://server/#/somePath', 'http://server/']); }) ); |
