aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2011-02-06 09:35:14 -0800
committerIgor Minar2011-02-06 09:35:14 -0800
commitea9ca651d2dd40ec057a166c6f324ea4fb881428 (patch)
tree2852c04856533e2dfa262997647d7d74f09412b5 /test
parentd6db4b174940782867d1cf42e1e0152046fe05c1 (diff)
downloadangular.js-ea9ca651d2dd40ec057a166c6f324ea4fb881428.tar.bz2
fix how redirection is handled and tested
Diffstat (limited to 'test')
-rw-r--r--test/servicesSpec.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js
index e3437dc2..0876f986 100644
--- a/test/servicesSpec.js
+++ b/test/servicesSpec.js
@@ -486,7 +486,7 @@ describe("service", function(){
expect(onChangeSpy).not.toHaveBeenCalled();
scope.$eval(); //triggers initial route change - match the redirect route
- $browser.poll(); //triger route change - match the route we redirected to
+ $browser.defer.flush(); //triger route change - match the route we redirected to
expect($location.hash).toBe('/foo');
expect($route.current.template).toBe('foo.html');
@@ -495,8 +495,7 @@ describe("service", function(){
onChangeSpy.reset();
$location.updateHash('');
scope.$eval(); //match the redirect route + update $browser
- $browser.poll(); //match the route we redirected to
-
+ $browser.defer.flush(); //match the route we redirected to
expect($location.hash).toBe('/foo');
expect($route.current.template).toBe('foo.html');
@@ -505,7 +504,7 @@ describe("service", function(){
onChangeSpy.reset();
$location.updateHash('/baz');
scope.$eval(); //match the redirect route + update $browser
- $browser.poll(); //match the route we redirected to
+ $browser.defer.flush(); //match the route we redirected to
expect($location.hash).toBe('/bar');
expect($route.current.template).toBe('bar.html');