From ea9ca651d2dd40ec057a166c6f324ea4fb881428 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sun, 6 Feb 2011 09:35:14 -0800 Subject: fix how redirection is handled and tested --- test/servicesSpec.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test') 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'); -- cgit v1.2.3