aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorquazzie2013-03-22 10:35:50 +0100
committerPete Bacon Darwin2013-05-01 14:51:05 +0100
commitac086ae61619a86ee77149f39193d264a191932a (patch)
tree67dfd34e9b402f650fc83f6b56bc5defe0d38835 /test
parentf75a2b093f7a5ba68ea3e421c02acb6cd17c1896 (diff)
downloadangular.js-ac086ae61619a86ee77149f39193d264a191932a.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')
-rw-r--r--test/ng/locationSpec.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js
index bf91c250..b6efe783 100644
--- a/test/ng/locationSpec.js
+++ b/test/ng/locationSpec.js
@@ -1216,7 +1216,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);
@@ -1227,6 +1227,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/']);
})
);